Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.4.7
-
None
-
None
Description
class A { C plus(B b) { println "plus" new C() } } class B {} class C {} class Foo { A getProp() { println "get" new A() } void setProp(C c) { println "set" } } @CompileStatic class Main { static void main(String[] args) { def foo = new Foo() foo.prop += new B() } }
Correctly prints without @CompileStatic:
get plus set
With @CompileStatic fails with:
Error:(32, 9) Groovyc: [Static type checking] - Cannot assign value of type B to variable of type C