Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.6
-
None
Description
@CompileStatic class A { static <U> void foo(U a, U b) {} static void main(String[] args) { foo(1, "") } }
The following code fails to compile with error
Groovyc: [Static type checking] - Cannot call <U> A#foo(U, U) with arguments [int, java.lang.String]
U should be inferred to LUB(Integer, String), hence the call should be successful.
Attachments
Issue Links
- is related to
-
GROOVY-5692 TypeChecked not checking generics placeholder types across arguments when a method has multiple arguments
- Closed