Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
compiling this code:
@groovy.transform.TypeChecked
def foo() {
List things = []
Serializable s = new Serializable() {
def size() {
things.size()
}
}
s.size()
}
println foo()
yields this error:
[Static type checking] - Cannot find matching method ConsoleScript51$1#<init>(ConsoleScript51, java.util.List) at line: 4, column: 22
If you make the things list be something more specific, e.g. ['a', 'b'], then the error message becomes more specific:
[Static type checking] - Cannot find matching method ConsoleScript54$1#<init>(ConsoleScript54, java.util.List <java.lang.String>) at line: 4, column: 22