mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
[Kotlin][Java inference] Apply use site scope for j.l.Object
With KMP projects it's possible that a class can reside in a common module with no JDK available. Trying to use class' resolve scope for creating java.lang.Object type in this case will result in an incorrect type. Use site scope from a type comes from a JVM module which has a JDK available. KTIJ-28461 GitOrigin-RevId: b19fe424ce4f7745e7f6aad7c5a34bb3912f5a56
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1aa062a419
commit
9ea82d1a98
@@ -97,7 +97,7 @@ public final class GenericsUtil {
|
||||
|
||||
PsiClass[] supers = getLeastUpperClasses(aClass, bClass);
|
||||
if (supers.length == 0) {
|
||||
return PsiType.getJavaLangObject(manager, aClass.getResolveScope());
|
||||
return PsiType.getJavaLangObject(manager, type1.getResolveScope());
|
||||
}
|
||||
|
||||
final PsiElementFactory elementFactory = JavaPsiFacade.getElementFactory(manager.getProject());
|
||||
|
||||
@@ -15,6 +15,6 @@ public class Ktij28461 {
|
||||
}
|
||||
|
||||
public static void cstOfJavaPrimitiveAndCommonClass(CommonClass cc) {
|
||||
jGeneric<error descr="'jGeneric(K, K)' in 'pack.Ktij28461' cannot be applied to '(int, pack.CommonClass)'">(1, cc)</error>;
|
||||
jGeneric(1, cc);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class JavaReference {
|
||||
cd.ktFunVarargGeneric(1, jc);
|
||||
|
||||
jd.ktFunVarargGeneric(1, "");
|
||||
jd.ktFunVarargGeneric<error descr="'ktFunVarargGeneric(T...)' in 'pack.JvmVarArgDecl' cannot be applied to '(int, pack.CommonClassForVA)'">(1, cc)</error>; // Error is here.
|
||||
jd.ktFunVarargGeneric(1, cc); // Error is here.
|
||||
jd.ktFunVarargGeneric(1, jc);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user