mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
expected variable type: make type denotable (IDEA-136958)
This commit is contained in:
@@ -422,7 +422,7 @@ public class GenericsUtil {
|
||||
}
|
||||
else {
|
||||
final PsiType accepted = typeArgument.accept(this);
|
||||
if (typeArgument instanceof PsiIntersectionType) {
|
||||
if (typeArgument instanceof PsiIntersectionType && !(accepted instanceof PsiWildcardType)) {
|
||||
toPut = PsiWildcardType.createExtends(typeParameter.getManager(), accepted);
|
||||
}
|
||||
else {
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
class Test {
|
||||
|
||||
interface I {}
|
||||
enum X implements I {a}
|
||||
enum Y implements I {a}
|
||||
|
||||
{
|
||||
List<? extends Enum<? extends Enum<? extends Enum<?>>>> l = Arrays.asList(X.a, Y.a);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
import java.util.Arrays;
|
||||
|
||||
class Test {
|
||||
|
||||
interface I {}
|
||||
enum X implements I {a}
|
||||
enum Y implements I {a}
|
||||
|
||||
{
|
||||
<selection>Arrays.asList(X.a, Y.a)</selection>;
|
||||
}
|
||||
}
|
||||
@@ -449,6 +449,10 @@ public class IntroduceVariableTest extends LightCodeInsightTestCase {
|
||||
doTest(new MockIntroduceVariableHandler("l", false, false, false, "I<java.lang.String>", true));
|
||||
}
|
||||
|
||||
public void testIntersectionWildcardExpectedType() {
|
||||
doTest(new MockIntroduceVariableHandler("l", false, false, false, "java.util.List<? extends java.lang.Enum<? extends java.lang.Enum<? extends java.lang.Enum<?>>>>", true));
|
||||
}
|
||||
|
||||
public void testMethodRefNotInContextInferredFilterWithNonAcceptableSince() {
|
||||
//though test extracts method reference which is not suppose to appear with language level 1.7
|
||||
//@since 1.8 in Consumer prevent it to appear at first position
|
||||
|
||||
Reference in New Issue
Block a user