mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
treat Object[] (IDEA-99061)
This commit is contained in:
+1
-1
@@ -546,7 +546,7 @@ public class PsiResolveHelperImpl implements PsiResolveHelper {
|
||||
if (arg == null ||
|
||||
arg.getDeepComponentType() instanceof PsiPrimitiveType ||
|
||||
arg instanceof PsiIntersectionType ||
|
||||
(psiClass != null && (isContraVariantPosition || !CommonClassNames.JAVA_LANG_OBJECT.equals(psiClass.getQualifiedName())))) {
|
||||
(psiClass != null && (isContraVariantPosition || !CommonClassNames.JAVA_LANG_OBJECT.equals(psiClass.getQualifiedName()) || (arg instanceof PsiArrayType)))) {
|
||||
PsiType bound = intersectAllExtends(typeParam, arg);
|
||||
return new Pair<PsiType, ConstraintType>(bound, ConstraintType.SUPERTYPE);
|
||||
}
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
class Test {
|
||||
{
|
||||
String a = cast("str");
|
||||
Integer[] b = cast(new Integer[0]);
|
||||
Object[] c = cast(new Object[0]);
|
||||
}
|
||||
|
||||
private <T> T cast(Object obj) {
|
||||
return (T)obj;
|
||||
}
|
||||
}
|
||||
@@ -201,6 +201,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void testIDEA67597() { doTest5(false); }
|
||||
public void testIDEA57539() { doTest5(false); }
|
||||
public void testIDEA67570() { doTest5(false); }
|
||||
public void testIDEA99061() { doTest5(false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user