mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
accept raw subtyping when instance method is called on raw type (IDEA-107957)
This commit is contained in:
+37
@@ -0,0 +1,37 @@
|
||||
class Test1 {
|
||||
|
||||
private static final Foo<Boolean> test = new Foo().method(Boolean.TRUE);
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(test);
|
||||
}
|
||||
|
||||
public static class Foo<T> {
|
||||
public Foo<Boolean> method(boolean arg) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public <T extends Enum<T>> Foo<T> method(T arg) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class Test2 {
|
||||
|
||||
private static final Foo<Boolean> test = Foo.method(Boolean.TRUE);
|
||||
|
||||
public static void main(String[] args) {
|
||||
System.out.println(test);
|
||||
}
|
||||
|
||||
public static class Foo<T> {
|
||||
public static Foo<Boolean> method(boolean arg) {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static <T extends Enum<T>> Foo<T> method(T arg) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user