java-topology/test/langtools/tools/javac/cast/5064736/T5064736.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

17 lines
393 B
Java

/*
* @test /nodynamiccopyright/
* @bug 5064736
* @summary Incompatible types are cast without error
* @compile/fail/ref=T5064736.out -XDrawDiagnostics T5064736.java
*/
public class T5064736 {
class A {}
class B extends A {}
public class Foo<T> {
public <U extends B> void foo(Foo<? super A> param) {
Foo<U> foo = (Foo<U>)param;
}
}
}