Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.17, 3.0.11, 4.0.3
-
None
Description
I have the following Groovy program.
@groovy.transform.TypeChecked class Test { public void m() { Foo<? super C> x = new Foo<B>(); } } class A {} class B extends A {} class C extends B {} class Foo<T extends A> { }
Actual Behavior
The program does not compile, and I get the following error.
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Test.groovy: 4: The type ? is not a valid substitute for the bounded parameter <T extends A> @ line 4, column 9. Foo<? super C> x = new Foo<B>(); ^ 1 error
Expected Behavior
Compile successfully.
Attachments
Issue Links
- relates to
-
GROOVY-11258 AssertJ collection mapping is badly supported
- In Progress
-
GROOVY-10756 STC: parameterized and bounded return value for java class property
- Closed