Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Consider the following:
@groovy.transform.CompileStatic void test(ref) { if (ref === null) { //... } }
The null check is written as a call to ScriptBytecodeAdapter#compareIdentical. For "ref == null" direct null-comparison bytecode is generated. There may also be opportunities for constant or reference-to-reference comparisons as well.