mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 03:13:40 +07:00
accept casts as unchecked from generic types with type parameter with upper bounds as type argument: check parameter bounds first
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
import java.util.Map;
|
||||
|
||||
class Test {
|
||||
public static <M extends Map<String, Integer>> void groupingBy(Supplier<M> mapFactory) {
|
||||
Supplier<Map<String, Integer>> mangledFactory = <warning descr="Unchecked cast: 'Test.Supplier<M>' to 'Test.Supplier<java.util.Map<java.lang.String,java.lang.Integer>>'">(Supplier<Map<String, Integer>>) mapFactory</warning>;
|
||||
System.out.println(mangledFactory);
|
||||
}
|
||||
|
||||
interface Supplier<<warning descr="Type parameter 'G' is never used">G</warning>> {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user