Fixes according to review IDEA-CR-61871

GitOrigin-RevId: 206247808adba050a5839ee8ac0be790bb53c8ac
This commit is contained in:
Tagir Valeev
2020-04-24 15:10:36 +07:00
committed by intellij-monorepo-bot
parent 53f05d4976
commit 3643ee6506
3 changed files with 3 additions and 2 deletions

View File

@@ -164,7 +164,7 @@ public class PsiPolyExpressionUtil {
type = method.getReturnType();
if (result instanceof MethodCandidateInfo) {
// Spec: Note that, for a generic method, this is the type before instantiating the method's type arguments.
PsiSubstitutor substitutor = ((MethodCandidateInfo)result).getSubstitutorExceptMethodTypeArguments();
PsiSubstitutor substitutor = ((MethodCandidateInfo)result).getSubstitutorFromQualifier();
type = substitutor.substitute(type);
}
}

View File

@@ -330,7 +330,7 @@ public class MethodCandidateInfo extends CandidateInfo{
}
@NotNull
public PsiSubstitutor getSubstitutorExceptMethodTypeArguments() {
public PsiSubstitutor getSubstitutorFromQualifier() {
return super.getSubstitutor();
}

View File

@@ -6,6 +6,7 @@ class Conditional {
int a2 = b ? null : 1;
int a3 = b ? null : f1();
int a4 = b ? <error descr="Incompatible types. Found: 'null', required: 'int'">null</error> : f2();
int a5 = b ? <error descr="Incompatible types. Found: 'null', required: 'int'">null</error> : Conditional.<Integer, Integer>f2();
Long someNum = b ? getNum(5L) : <error descr="Incompatible types. Found: 'int', required: 'java.lang.Long'">0</error>;
}