java-topology/test/langtools/tools/javac/lambda/MostSpecific32.java
russell@unturf.com 0a580b313d undefect. CWE-407 — 63 sites patched across 27 ecosystems
Authors: russell@unturf.com · brackishbert@gmail.com · foxhop.net · TimeHexOn.com

Patches, unit tests, benchmarks, whitepaper, and outreach briefs.
Public domain — no copyright claimed. Use freely.
2026-03-26 17:11:57 -04:00

22 lines
561 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8144767
* @summary Correct most-specific test when wildcards appear in functional interface type
* @compile/fail/ref=MostSpecific32.out -XDrawDiagnostics MostSpecific32.java
*/
class MostSpecific32 {
interface A<T> {}
interface B<T> extends A<T> {}
interface F1<S> { A<S> apply(); }
interface F2<S> { B<S> apply(); }
static void m1(F1<? extends Number> f1) {}
static void m1(F2<? extends Number> f2) {}
void test() {
m1(() -> null); // B<CAP ext Number> </: A<Number>
}
}