Do preparation of enhancement as well (for types with enhancement), during subtype checks

^KT-47899 Fixed
This commit is contained in:
Victor Petukhov
2021-07-29 11:23:13 +03:00
committed by teamcityserver
parent c5d783596d
commit 5684b6977a
6 changed files with 37 additions and 1 deletions
@@ -144,6 +144,9 @@ fun KotlinType.unwrapEnhancementDeeply() = getEnhancementDeeply() ?: this
fun KotlinType.unwrapEnhancement(): KotlinType = getEnhancement() ?: this
fun UnwrappedType.inheritEnhancement(origin: KotlinType, transform: (KotlinType) -> KotlinType): UnwrappedType =
wrapEnhancement(origin.getEnhancement()?.let(transform))
fun UnwrappedType.inheritEnhancement(origin: KotlinType): UnwrappedType = wrapEnhancement(origin.getEnhancement())
fun UnwrappedType.wrapEnhancement(enhancement: KotlinType?): UnwrappedType {
@@ -68,7 +68,7 @@ abstract class KotlinTypePreparator : AbstractTypePreparator {
unwrappedType
}
}
}.inheritEnhancement(unwrappedType)
}.inheritEnhancement(unwrappedType, ::prepareType)
}
object Default : KotlinTypePreparator()