java-topology/test/langtools/tools/javac/cast/4916620/T4916620.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
509 B
Java

/*
* @test /nodynamiccopyright/
* @bug 4916620
* @summary legal cast is rejected
* @author Christian Plesner Hansen
* @compile/ref=T4916620.out -XDrawDiagnostics -Xlint:unchecked T4916620.java
* @compile -Xlint:unchecked T4916620.java
*/
public class T4916620 {
static class BB<T, S> { }
static class BD<T> extends BB<T, T> { }
void f() {
BD<Number> bd = new BD<Number>();
BB<? extends Number, ? super Integer> bb = bd;
Object o = (BD<Number>) bb;
}
}