Create DONT_CARE type only for dependent lambdas (i.e. to be resolved through the type inference later)

^KT-47493 Fixed
This commit is contained in:
Victor Petukhov
2021-08-06 10:13:35 +03:00
committed by teamcityserver
parent dbdc6176f0
commit 1966915e92
9 changed files with 58 additions and 1 deletions
@@ -394,7 +394,7 @@ public class ExpressionTypingServices {
return blockLevelVisitor.getTypeInfo(statementExpression, context.replaceExpectedType(expectedType), true);
}
if (KtPsiUtil.deparenthesize(statementExpression) instanceof KtLambdaExpression) {
if (KtPsiUtil.deparenthesize(statementExpression) instanceof KtLambdaExpression && context.contextDependency == ContextDependency.DEPENDENT) {
KotlinTypeInfo typeInfo = createDontCareTypeInfoForNILambda(statementExpression, context);
if (typeInfo != null) return typeInfo;
}