mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-56950 IDEA doesn't consider types int and Integer as identical
This commit is contained in:
+2
-1
@@ -103,7 +103,8 @@ public class TypesUtil {
|
||||
if (candidates.length == 1) {
|
||||
final PsiElement element = candidates[0].getElement();
|
||||
if (element instanceof PsiMethod) {
|
||||
return candidates[0].getSubstitutor().substitute(PsiUtil.getSmartReturnType((PsiMethod)element));
|
||||
return boxPrimitiveType(candidates[0].getSubstitutor().substitute(PsiUtil.getSmartReturnType((PsiMethod)element)),
|
||||
place.getManager(), place.getResolveScope());
|
||||
}
|
||||
}
|
||||
return null;
|
||||
|
||||
+3
-2
@@ -102,12 +102,13 @@ public class GrIndexPropertyImpl extends GrExpressionImpl implements GrIndexProp
|
||||
componentType = TypesUtil.boxPrimitiveType(((PsiArrayType)thisType).getComponentType(), getManager(), getResolveScope());
|
||||
}
|
||||
else if (InheritanceUtil.isInheritor(thisType, CommonClassNames.JAVA_UTIL_MAP) && argTypes.length == 1) {
|
||||
componentType = substituteTypeParameter(thisType, CommonClassNames.JAVA_UTIL_MAP, 1, true);
|
||||
componentType = TypesUtil
|
||||
.boxPrimitiveType(substituteTypeParameter(thisType, CommonClassNames.JAVA_UTIL_MAP, 1, true), getManager(), getResolveScope());
|
||||
}
|
||||
|
||||
if (overloadedOperatorType != null &&
|
||||
(componentType == null || !TypesUtil.isAssignable(overloadedOperatorType, componentType, getManager(), getResolveScope()))) {
|
||||
return overloadedOperatorType;
|
||||
return TypesUtil.boxPrimitiveType(overloadedOperatorType, getManager(), getResolveScope());
|
||||
}
|
||||
return componentType;
|
||||
}
|
||||
|
||||
@@ -230,4 +230,7 @@ public class GroovyCompletionTest extends GroovyCompletionTestBase {
|
||||
"}");
|
||||
doSmartTest();
|
||||
}
|
||||
}
|
||||
|
||||
public void testIntCompletionInPlusMethod() {doBasicTest();}
|
||||
public void testIntCompletionInGenericParameter() {doBasicTest();}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ abstract public class GroovyCompletionTestBase extends LightCodeInsightFixtureTe
|
||||
myFixture.checkResultByFile(getTestName(false) + "_after.groovy", true);
|
||||
}
|
||||
|
||||
protected void doBasicTest() throws Exception {
|
||||
protected void doBasicTest() {
|
||||
myFixture.testCompletion(getTestName(false) + ".groovy", getTestName(false) + "_after.groovy");
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
List<int> list
|
||||
list.get(0).intV<caret>
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
List<int> list
|
||||
list.get(0).intValue()
|
||||
@@ -0,0 +1,5 @@
|
||||
class X {
|
||||
int plus(X x) {}
|
||||
}
|
||||
|
||||
(new X()+new X()).intV<caret>
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class X {
|
||||
int plus(X x) {}
|
||||
}
|
||||
|
||||
(new X()+new X()).intValue()
|
||||
Reference in New Issue
Block a user