From 88a9349f32781ae4110a1e60efd82ce786a45360 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Tue, 30 Apr 2019 17:13:41 +0300 Subject: [PATCH] Use intersection of star projection type-param bounds instead of type --- .../src/org/jetbrains/kotlin/types/TypeApproximator.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt b/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt index 0b6d062e716..58592e5e654 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/types/TypeApproximator.kt @@ -286,7 +286,11 @@ abstract class AbstractTypeApproximator(val ctx: TypeSystemInferenceExtensionCon // Once NI will be more stabilized, we'll use more specific type - else -> type.typeConstructorProjection().getType()//.unwrap() + else -> { + val projection = type.typeConstructorProjection() + if (projection.isStarProjection()) intersectTypes(supertypes.toList()) + else projection.getType() + } } val baseSubType = type.lowerType() ?: nothingType()