mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-25 14:25:04 +07:00
unchecked casts: ignore extends wildcards with the same bound as corresponding type parameter bound (IDEA-71629)
This commit is contained in:
+15
-1
@@ -55,4 +55,18 @@ class M {
|
||||
public static <T extends K> L f(T t) {
|
||||
return (L) t; //this should NOT generate unchecked cast
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class UncheckedCastFalsePositive {
|
||||
|
||||
public static void method(Object something) {
|
||||
if (something instanceof NumberList) {
|
||||
NumberList<? extends Number> <warning descr="Variable 'numberList' is never used">numberList</warning> = (NumberList<? extends Number>) something;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class NumberList<E extends Number> extends ArrayList<E> {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user