NI: approximate not top-level captured types during code generation

^KT-40693 Fixed
This commit is contained in:
Victor Petukhov
2020-08-04 16:03:59 +03:00
parent f6d7e7c52a
commit f45de9d8fb
9 changed files with 64 additions and 1 deletions
@@ -2835,7 +2835,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
TypeApproximator approximator = new TypeApproximator(state.getModule().getBuiltIns());
KotlinType approximatedType =
CapturedTypeConstructorKt.isCaptured(type) ?
TypeUtils.contains(type, (containedType) -> CapturedTypeConstructorKt.isCaptured(containedType)) ?
(KotlinType) approximator.approximateToSuperType(
type, TypeApproximatorConfiguration.InternalTypesApproximation.INSTANCE
) : null;