Maurizio Cimadamore 5d6029baac 8015505: Spurious inference error when return type of generic method requires unchecked conversion to target
Use check context compatibility during 15.12.2.8 check (only when JDK 8 inference is enabled)

Reviewed-by: jjg
2013-06-04 11:34:31 +01:00

19 lines
413 B
Java

/**
* @test /nodynamiccopyright/
* @bug 8015505
* @summary Spurious inference error when return type of generic method requires unchecked conversion to target
* @compile/fail/ref=T8015505.out -Xlint:-options -source 7 -XDrawDiagnostics T8015505.java
* @compile T8015505.java
*/
import java.util.List;
class T8015505 {
<Z> List m() { return null; }
void test() {
List<?> l = m();
}
}