Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.4
-
None
Description
I expect these classes to be compiled but it won't.
import groovy.transform.* @CompileStatic class Greeting implements Serializable { String who }
import groovy.transform.* @CompileStatic class GreetingActor { def receive = { if(it instanceof Greeting) { println "Hello ${it.who}" } } }
The type of variable "it" in the Closure receive should be inferred as type Greeting. To reproduce call
$ groovyc Greeting.groovy GreetingActor.groovy
Thank you.