Skip to content

Commit 5ceb973

Browse files
committed
Minor refactoring of getQualifiedExpressionTypeInfo
1 parent bb68aac commit 5ceb973

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ public Boolean invoke(KtSimpleNameExpression nameExpression) {
399399

400400
boolean unconditional = true;
401401
DataFlowInfo unconditionalDataFlowInfo = receiverDataFlowInfo;
402-
ExpressionTypingContext contextForSelector = currentContext;
403402

404403
for (CallExpressionElement element : elementChain) {
405404
if (receiverType == null) {
@@ -413,14 +412,14 @@ public Boolean invoke(KtSimpleNameExpression nameExpression) {
413412

414413
boolean lastStage = element.getQualified() == expression;
415414
// Drop NO_EXPECTED_TYPE / INDEPENDENT at last stage
416-
ExpressionTypingContext baseContext = lastStage ? context : currentContext;
415+
ExpressionTypingContext contextForSelector = lastStage ? context : currentContext;
417416
if (TypeUtils.isNullableType(receiverType) && !element.getSafe()) {
418417
// Call with nullable receiver: take unconditional data flow info
419-
contextForSelector = baseContext.replaceDataFlowInfo(unconditionalDataFlowInfo);
418+
contextForSelector = contextForSelector.replaceDataFlowInfo(unconditionalDataFlowInfo);
420419
}
421420
else {
422421
// Take data flow info from the current receiver
423-
contextForSelector = baseContext.replaceDataFlowInfo(receiverDataFlowInfo);
422+
contextForSelector = contextForSelector.replaceDataFlowInfo(receiverDataFlowInfo);
424423
}
425424

426425
if (receiver instanceof ReceiverValue) {

0 commit comments

Comments
 (0)