Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.11
-
None
Description
Consider the following:
package c import groovy.transform.CompileStatic @CompileStatic class C { class MyBean { String foo int bar } class AnotherClass { int createInt() { return 1 } String createString() { return 'foo' } } void doSomething() { def a = new AnotherClass() def b = new MyBean(foo: a.createString()) } }
The compiler complains on new MyBean(...):
\src\main\groovy\c\C.groovy: 22: [Static type checking] - Cannot find matching method c.C$MyBean#<init>(c.C, java.util.LinkedHashMap <java.lang.String, java.lang.String>). Please check if the declared type is right and if the method exists. @ line 22, column 11.
Changing it to new C.MyBean(...) works though.