Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
Description
I tried to see if this was already fixed or covered by another issue, but I couldn't find something like it... Here is the code:
class Foo { @groovy.transform.CompileStatic public void blah() { ((GroovyObject)this); } }
This is currently causing me an issue when trying to build grails-core in STS (it has a snippet somewhat similar to this, but obviously it does a bit more). For some reason it works through the gradle build on the command line, but not if I just run groovy 2.0.0 groovyc against that class above. I also grabbed a snapshot and tried it, which seemed to give the same result.
Oh, the error is:
> groovyc Foo.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Foo.groovy: 4: [Static type checking] - Inconvertible types: cannot cast Foo to groovy.lang.GroovyObject @ line 4, column 3. ((GroovyObject)this); ^ 1 error