KT-4866 Resolve does not work inside brackets with unresolved reference before
#KT-4866 Fixed
This commit is contained in:
@@ -130,6 +130,11 @@ public class DebugInfoUtil {
|
||||
|
||||
boolean resolved = target != null;
|
||||
boolean markedWithError = markedWithErrorElements.containsKey(expression);
|
||||
if (expression instanceof JetArrayAccessExpression &&
|
||||
markedWithErrorElements.containsKey(((JetArrayAccessExpression) expression).getArrayExpression())) {
|
||||
// if 'foo' in 'foo[i]' is unresolved it means 'foo[i]' is unresolved (otherwise 'foo[i]' is marked as 'missing unresolved')
|
||||
markedWithError = true;
|
||||
}
|
||||
JetType expressionType = bindingContext.get(EXPRESSION_TYPE, expression);
|
||||
DiagnosticFactory factory = markedWithErrorElements.get(expression);
|
||||
if (declarationDescriptor != null &&
|
||||
|
||||
+6
-1
@@ -1230,7 +1230,12 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
JetTypeInfo arrayTypeInfo = facade.getTypeInfo(arrayExpression, oldContext.replaceExpectedType(NO_EXPECTED_TYPE)
|
||||
.replaceContextDependency(INDEPENDENT));
|
||||
JetType arrayType = arrayTypeInfo.getType();
|
||||
if (arrayType == null) return arrayTypeInfo;
|
||||
if (arrayType == null) {
|
||||
for (JetExpression indexExpression : arrayAccessExpression.getIndexExpressions()) {
|
||||
facade.getTypeInfo(indexExpression, oldContext);
|
||||
}
|
||||
return arrayTypeInfo;
|
||||
}
|
||||
|
||||
DataFlowInfo dataFlowInfo = arrayTypeInfo.getDataFlowInfo();
|
||||
ExpressionTypingContext context = oldContext.replaceDataFlowInfo(dataFlowInfo);
|
||||
|
||||
Reference in New Issue
Block a user