jdk-24/langtools/test/tools/javac/generics/inference/CaptureLowerBound.java
Dan Smith 3999672b7a 8075793: Source incompatibility for inference using -source 7
In pre-8 sources, avoid capture variables as inference bounds, consistent with old javac behavior

Reviewed-by: vromero, mcimadamore
2016-12-14 17:56:11 -07:00

21 lines
463 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8039214
* @summary Capture variable as an inference variable's lower bound
* @compile CaptureLowerBound.java
* @compile/fail/ref=CaptureLowerBound7.out -Xlint:-options -source 7 -XDrawDiagnostics CaptureLowerBound.java
*/
public class CaptureLowerBound {
interface I<X1,X2> {}
static class C<T> implements I<T,T> {}
<X> void m(I<? extends X, X> arg) {}
void test(C<?> arg) {
m(arg);
}
}