jdk-24/test/langtools/tools/javac/generics/inference/CaptureLowerBoundDeref.java
2022-09-01 16:43:50 +00:00

24 lines
519 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8075793
* @summary Capture variable as an inference lower bound followed by a member reference
* @compile/fail/ref=CaptureLowerBoundDeref.out -XDrawDiagnostics CaptureLowerBoundDeref.java
*
*/
class CaptureLowerBoundDeref {
interface Wrapper<T> {
I<T> get();
}
interface I<T> {}
interface K<T> { void take(T arg); }
<T> K<T> m(I<? extends T> arg) { return null; }
void test(Wrapper<?> w) {
m(w.get()).take(new Object());
}
}