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

18 lines
512 B
Java

/*
* @test /nodynamiccopyright/
* @author Maurizio Cimadamore
* @bug 6557182
* @summary Unchecked warning *and* inconvertible types
* @compile/fail/ref=T6557182.out -XDrawDiagnostics -Xlint:unchecked T6557182.java
*/
class T6557182 {
<T extends Number & Comparable<String>> void test1(T t) {
Comparable<Integer> ci = (Comparable<Integer>) t;
}
<T extends Number & Comparable<? extends Number>> void test2(T t) {
Comparable<Integer> ci = (Comparable<Integer>) t;
}
}