mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
proceed static factories instead of constructors to calculate expected types when diamonds are used (IDEA-153520)
This commit is contained in:
+20
@@ -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> {}
|
||||
+15
@@ -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> {}
|
||||
+7
@@ -153,6 +153,13 @@ public void testConvertToObjectStream() {
|
||||
checkResultByFile("/" + getTestName(false) + "-out.java");
|
||||
}
|
||||
|
||||
public void testInsideNewExpressionWithDiamondAndOverloadConstructors() throws Exception {
|
||||
configureByTestName();
|
||||
myFixture.complete(CompletionType.SMART, 1);
|
||||
myFixture.type('\n');
|
||||
checkResultByFile("/" + getTestName(false) + "-out.java");
|
||||
}
|
||||
|
||||
public void testCollectorsToList() {
|
||||
doTest(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user