Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
class l { static <T> T getAt(T x) {return x} } @groovy.transform.CompileStatic def m() { List<Integer> x = l[1,2,3] return x } m()
this code fails to compile
{pre}[Static type checking] - Cannot find matching method java.lang.Class#getAt(java.util.List). Please check if the declared type is correct and if the method exists.
@ line 7, column 22.
List<Integer> x = l[1,2,3]
^
1 error{pre}
The error message makes me think that l is seen as an instance of Class instead of the class l. Changing the class name l does not make a difference for me. I tested with groovy 3.0.1 and 2.4.7, same error, so unlikely to be new