mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
temp decline raw assignments (IDEA-92022)
This commit is contained in:
@@ -970,11 +970,19 @@ public class TypeConversionUtil {
|
||||
}
|
||||
}
|
||||
else {
|
||||
boolean effectiveAllowUncheckedConversion = allowUncheckedConversion;
|
||||
if (typeRight instanceof PsiCapturedWildcardType) {
|
||||
effectiveAllowUncheckedConversion = false;
|
||||
final PsiClass psiClass = PsiUtil.resolveClassInType(((PsiCapturedWildcardType)typeRight).getWildcard().getBound());
|
||||
if (psiClass != null && !psiClass.hasTypeParameters()) {
|
||||
effectiveAllowUncheckedConversion = allowUncheckedConversion;
|
||||
}
|
||||
}
|
||||
if (leftWildcard.isExtends()) {
|
||||
return isAssignable(leftBound, typeRight, allowUncheckedConversion && !containsWildcards(leftBound));
|
||||
return isAssignable(leftBound, typeRight, effectiveAllowUncheckedConversion && !containsWildcards(leftBound));
|
||||
}
|
||||
else { // isSuper
|
||||
return isAssignable(typeRight, leftBound, allowUncheckedConversion && !containsWildcards(leftBound));
|
||||
return isAssignable(typeRight, leftBound, effectiveAllowUncheckedConversion && !containsWildcards(leftBound));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
class GetClassClient {
|
||||
public void use() {
|
||||
Class<? extends LocalGeneric> v1 = null;
|
||||
Class<? extends LocalGeneric<Object>> v2 = null;
|
||||
v1 = v2;
|
||||
<error descr="Incompatible types. Found: 'java.lang.Class<capture<? extends GetClassClient.LocalGeneric>>', required: 'java.lang.Class<? extends GetClassClient.LocalGeneric<java.lang.Object>>'">v2 = v1</error>;
|
||||
}
|
||||
|
||||
public static class LocalGeneric<T> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface Comparable<T extends Comparable<T>> {}
|
||||
class List<T> {}
|
||||
|
||||
class Foo implements Comparable<Foo> {
|
||||
public static void main(String[] args){
|
||||
List<? extends Foo> list = null;
|
||||
List<? extends Comparable> c = null;
|
||||
c = list;
|
||||
}
|
||||
}
|
||||
@@ -193,6 +193,7 @@ public class GenericsHighlightingTest extends LightDaemonAnalyzerTestCase {
|
||||
public void _testIDEA94011() throws Exception { doTest(false); }
|
||||
public void testDifferentTypeParamsInOverloadedMethods() throws Exception { doTest(true); }
|
||||
public void testIDEA91626() throws Exception { doTest(true); }
|
||||
public void testIDEA92022() throws Exception { doTest(false); }
|
||||
|
||||
public void testJavaUtilCollections_NoVerify() throws Exception {
|
||||
PsiClass collectionsClass = getJavaFacade().findClass("java.util.Collections", GlobalSearchScope.moduleWithLibrariesScope(getModule()));
|
||||
|
||||
Reference in New Issue
Block a user