Propagate resolution results without ambiguity to constant evaluator
This allows to get rid of useless diagnostics that some value is not a constant
This commit is contained in:
+5
-5
@@ -1804,15 +1804,15 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
||||
}
|
||||
|
||||
Call call = CallMaker.makeCallForCollectionLiteral(collectionLiteralExpression);
|
||||
OverloadResolutionResults<FunctionDescriptor> functionResults = components.callResolver.resolveCallWithGivenName(
|
||||
OverloadResolutionResults<FunctionDescriptor> resolutionResults = components.callResolver.resolveCallWithGivenName(
|
||||
context, call, collectionLiteralExpression, collectionLiteralCallName);
|
||||
|
||||
if (!functionResults.isSuccess() || !functionResults.isSingleResult()) {
|
||||
// TODO: report an error
|
||||
// TODO: check that resolved function is from package `kotlin`, otherwise report an error
|
||||
if (!resolutionResults.isSingleResult()) {
|
||||
return TypeInfoFactoryKt.noTypeInfo(context);
|
||||
}
|
||||
|
||||
context.trace.record(COLLECTION_LITERAL_CALL, collectionLiteralExpression, functionResults.getResultingCall());
|
||||
return TypeInfoFactoryKt.createTypeInfo(functionResults.getResultingDescriptor().getReturnType(), context);
|
||||
context.trace.record(COLLECTION_LITERAL_CALL, collectionLiteralExpression, resolutionResults.getResultingCall());
|
||||
return TypeInfoFactoryKt.createTypeInfo(resolutionResults.getResultingDescriptor().getReturnType(), context);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user