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

19 lines
478 B
Java

/*
* @test /nodynamiccopyright/
* @bug 8020147
* @summary Spurious errors when compiling nested stuck lambdas
* @compile/fail/ref=T8020147.out -Werror -Xlint:cast -XDrawDiagnostics T8020147.java
*/
class T8020147 {
interface Function<X, Y> {
Y apply(X x);
}
<T> void g(Function<String, T> f) { }
<U> String m(U u, Function<U, U> fuu) { return null; }
void test() {
g(x->m("", i->(String)i));
g(x->m("", i->(String)x));
}
}