Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
The following program should not type check
class A<T> {} class B<T> extends A<T> {} class Test { B<? extends Number> x = new B<Double>(); A<Number> y = x; }
Expected behaviour
the compiler should have rejected the program and produced an error of the form (like javac does):
error: incompatible types: B<CAP#1> cannot be converted to A<Number> A<Number> y = x; ^ where CAP#1 is a fresh type-variable: CAP#1 extends Number from capture of ? extends Number 1 error
Tested against master
Attachments
Issue Links
- is related to
-
GROOVY-9074 CompileStatic does not throw expected exception
- Resolved