[API Usage] Refine type for each separate element in ExpressionTypingVisitorDispatcher
This commit is contained in:
committed by
Dmitry Savvinov
parent
a1b52b2f90
commit
694f521bfd
+10
@@ -181,6 +181,16 @@ public abstract class ExpressionTypingVisitorDispatcher extends KtVisitor<Kotlin
|
|||||||
if (result.getType() instanceof DeferredType) {
|
if (result.getType() instanceof DeferredType) {
|
||||||
result = result.replaceType(((DeferredType) result.getType()).getDelegate());
|
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);
|
context.trace.record(BindingContext.EXPRESSION_TYPE_INFO, expression, result);
|
||||||
}
|
}
|
||||||
catch (ReenteringLazyValueComputationException e) {
|
catch (ReenteringLazyValueComputationException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user