[FE 1.0] Don't expand type enhancement

Actually shallow type enhancement is primary, it's more specific

^KT-50734 Fixed
This commit is contained in:
Victor Petukhov
2022-05-10 17:19:01 +02:00
committed by teamcity
parent 59b92c02b4
commit 6c994787b3
10 changed files with 147 additions and 1 deletions
@@ -193,7 +193,7 @@ public class TypeSubstitutor implements TypeSubstitutorMarker {
KotlinType substitutedEnhancement = substitute(enhancement, originalProjection.getProjectionKind());
KotlinType resultingType = TypeWithEnhancementKt.wrapEnhancement(
substitution.getType().unwrap(),
substitutedEnhancement instanceof TypeWithEnhancement ? ((TypeWithEnhancement) substitutedEnhancement).getEnhancement() : substitutedEnhancement
substitutedEnhancement
);
return new TypeProjectionImpl(substitution.getProjectionKind(), resultingType);