accept raw subtyping when instance method is called on raw type (IDEA-107957)

This commit is contained in:
Anna Kozlova
2013-05-28 18:50:17 +04:00
parent 2f9f136dc8
commit 9661f35dbd
3 changed files with 39 additions and 1 deletions
@@ -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;
}
}
}