Maurizio Cimadamore bd420dc94e 7086586: Inference producing null type argument
Inference should fail in 15.12.2.7 when inference variables with 'nulltype' upper bounds are found

Reviewed-by: dlsmith
2011-09-16 14:16:11 +01:00

20 lines
440 B
Java

/**
* @test /nodynamiccopyright/
* @bug 7086586
* @summary Inference producing null type argument
* @compile/fail/ref=T7086586.out -XDrawDiagnostics T7086586.java
*/
import java.util.List;
class T7086586 {
<T> List<T> m(List<? super T> dummy) { return null; }
void test(List<?> l) {
String s = m(l).get(0);
Number n = m(l).get(0);
Exception e = m(l).get(0);
m(l).nonExistentMethod();
}
}