Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.2.2, 2.3.0-rc-1
-
None
-
None
Description
The following code fails to compile:
class Foo { List<String> items = [] } @groovy.transform.CompileStatic void m(Object o) { if (o instanceof Foo) { assert o.items.empty } }
error:
UG! exception in phase 'instruction selection' in source unit 'ConsoleScript1' Declaring class for method call to '<>' declared in Foo was not matched with found receiver java.lang.Object. This should not have happened! at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.extractPlaceHolders(StaticTypeCheckingVisitor.java:3957) at org.codehaus.groovy.transform.stc.StaticTypeCheckingVisitor.resolvePlaceHoldersFromDeclaration(StaticTypeCheckingVisitor.java:3900)
Only happens if the target property contains generic information.