[API Usage] Refine type for each separate element in ExpressionTypingVisitorDispatcher

This commit is contained in:
Denis Zharkov
2019-06-25 18:25:23 +03:00
committed by Dmitry Savvinov
parent a1b52b2f90
commit 694f521bfd
@@ -181,6 +181,16 @@ public abstract class ExpressionTypingVisitorDispatcher extends KtVisitor<Kotlin
if (result.getType() instanceof DeferredType) {
result = result.replaceType(((DeferredType) result.getType()).getDelegate());
}
KotlinType refinedType =
result.getType() != null
? components.kotlinTypeChecker.getKotlinTypeRefiner().refineType(result.getType())
: null;
if (refinedType != result.getType()) {
result = result.replaceType(refinedType);
}
context.trace.record(BindingContext.EXPRESSION_TYPE_INFO, expression, result);
}
catch (ReenteringLazyValueComputationException e) {