Class StaticTypesIsCaseWriter
java.lang.Object
org.codehaus.groovy.classgen.asm.sc.StaticTypesIsCaseWriter
Emits the
isCase call the type checker selected for a case
label, shared by the statically compiled switch expression and switch
statement writers so that a label resolves the same way in either position
(GROOVY-12407).- Since:
- 7.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanwriteDirectIsCase(WriterController controller, CaseStatement caseStatement, int selectorIndex, ClassNode selectorType) Emits the selectedisCaseas a direct method call viaStaticInvocationWriter.writeDirectMethodCall, leaving a boolean on the operand stack for the followingIFEQ.
-
Method Details
-
writeDirectIsCase
public static boolean writeDirectIsCase(WriterController controller, CaseStatement caseStatement, int selectorIndex, ClassNode selectorType) Emits the selectedisCaseas a direct method call viaStaticInvocationWriter.writeDirectMethodCall, leaving a boolean on the operand stack for the followingIFEQ.- Parameters:
controller- the writer controllercaseStatement- the arm whose label is being testedselectorIndex- local variable slot holding the switch selectorselectorType- type of that slot- Returns:
falsewhen the type checker selected no target, in which case the caller emits its own comparison;truewhen the call was written
-