Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
Description
This might be a known issue / limitation.
I have the following code
import java.util.* class Main { static final void test() { List<? extends Number> list = new LinkedList<Number>(); List<Number> x = list; // types are not compatible. List<Number> y = (List<? extends Object>) null // types are not compatible; list.add(1); // method call is not permitted. } }
Actual behavior
The code compiles without raising any errors.
Expected behavior
The compiler should have rejected the program by raising three type errors.
Notes
Tested against master