Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.0-rc-2
-
None
-
None
Description
SomeTrait.groovy
@groovy.transform.CompileStatic trait SomeTrait { static List stuff static void initStuff(List l) { stuff = l } }
$ groovy -version Groovy Version: 2.4.0-rc-2 JVM: 1.7.0_45 Vendor: Oracle Corporation OS: Mac OS X $ grv $ groovyc SomeTrait.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: SomeTrait.groovy: 6: [Static type checking] - Cannot find matching method SomeTrait#SomeTrait__stuff$set(java.util.List). Please check if the declared type is right and if the method exists. @ line 6, column 9. stuff = l ^ 1 error $
If I remove the @CompileStatic the code runs and does what I expect it to do.
Attachments
Issue Links
- relates to
-
GROOVY-7191 CompileStatic Will Not Allow Instance Method In Trait To Call Static Method
- Closed