Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I have the following program:
import java.util.function.Supplier; class A { static final <X extends Supplier<Number>> X m(X x, X y) { X z = (true) ? x : y z } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 10: [Static type checking] - Incompatible generic argument types. Cannot assign java.util.function.Supplier<java.lang.Object> to: X @ line 10, column 5. z ^ 1 error
Compile successfully
NOTE: The bug is triggered only when the type parameter is named other than `T`.
Tested against master
Attachments
Issue Links
- relates to
-
GROOVY-10601 Incompatible generic argument type when combining conditionals and bounded type parameters
- Closed