proceed static factories instead of constructors to calculate expected types when diamonds are used (IDEA-153520)

This commit is contained in:
Anna.Kozlova
2016-03-24 18:14:17 +01:00
parent 778f7f84df
commit 7712f6e443
5 changed files with 74 additions and 22 deletions
@@ -0,0 +1,20 @@
class Outer <U, V> {
Outer(Foo<? super U> a) {}
Outer(Bar<? super U, ? extends V> a) {}
{
Outer<String, String> o = new Outer<>(new Foo<String>() {
@Override
public void m() {
}
});
}
}
interface Foo<A> {
void m();
}
interface Bar<A, B> {}
@@ -0,0 +1,15 @@
class Outer <U, V> {
Outer(Foo<? super U> a) {}
Outer(Bar<? super U, ? extends V> a) {}
{
Outer<String, String> o = new Outer<>(new F<caret>);
}
}
interface Foo<A> {
void m();
}
interface Bar<A, B> {}