java-topology/test/langtools/tools/javac/lambda/8074381/T8074381a.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

35 lines
876 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8074381
* @summary java.lang.AssertionError during compiling
* @compile/fail/ref=T8074381a.out -XDrawDiagnostics T8074381a.java
*/
class T8074381a {
interface Sup<X> {
boolean m(X x);
}
interface Sub<X> extends Sup<String> {
boolean m(String s);
}
@SuppressWarnings({"deprecation", "removal"})
void testRaw() {
Sub s1 = c -> true;
Sub s2 = Boolean::new;
Sub s3 = new Sub() {
@Override
public boolean m(String o) { return true; }
};
}
@SuppressWarnings({"deprecation", "removal"})
void testNonRaw() {
Sub<Integer> s1 = c -> true;
Sub<Integer> s2 = Boolean::new;
Sub<Integer> s3 = new Sub<Integer>() {
@Override
public boolean m(String o) { return true; }
};
}
}