Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.14, 3.0.7, 4.0.0-alpha-2
-
None
-
None
Description
Consider the following:
@groovy.transform.CompileStatic class C { void m() { init(Collections.emptyList()) } private static void init(List<String> strings) { print strings } } new C().m()
Call to "init" is fails to match Collections.emptyList() to List<String>. If "init" is non-static, it works fine. Error displayed is:
Static type checking] - Cannot call C#init(java.util.List <java.lang.String>) with arguments [java.util.List <T extends java.lang.Object>]
Attachments
Issue Links
- relates to
-
GROOVY-10745 Type not captured correctly (regression in 2.5.18)
- Closed