Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
This bug may be related to GROOVY-10337.
I have the following program
class A<T> { A(T f, B<T, ? extends T> x){ } } class B<T1, T2> {} class Test { void test() { B<Integer, ? extends Integer> x = null; A<Integer> y = new A<>(1, x); } }
Actual behaviour
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 10: [Static type checking] - Incompatible generic argument types. Cannot assign A<? extends java.lang.Object> to: A<java.lang.Integer> @ line 10, column 20. A<Integer> y = new A<>(1, x); ^ 1 error
Expected behaviour
Compile successfully
Tested against master (https://github.com/apache/groovy/commit/de17150ee844a943c070c01c07b81fd547ff074d).
Attachments
Issue Links
- is related to
-
GROOVY-10347 STC: lowed bound wildcard inference produces false positives
- Closed