[FIR, IR] Check for strict subtypes during actualization
^KT-65775 Fixed Review: https://jetbrains.team/p/kt/reviews/14906/timeline
This commit is contained in:
+3
-4
@@ -165,10 +165,9 @@ object AbstractExpectActualChecker {
|
||||
val expectSupertypes = expectClassSymbol.superTypes.filterNot { it.typeConstructor().isAnyConstructor() }
|
||||
val actualType = actualClassSymbol.defaultType
|
||||
return expectSupertypes.all { expectSupertype ->
|
||||
actualTypeIsSubtypeOfExpectType(
|
||||
expectType = substitutor.safeSubstitute(expectSupertype),
|
||||
actualType = actualType
|
||||
)
|
||||
val expectType = substitutor.safeSubstitute(expectSupertype)
|
||||
isSubtypeOf(superType = expectType, subType = actualType) &&
|
||||
!isSubtypeOf(superType = actualType, subType = expectType)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -131,9 +131,9 @@ interface ExpectActualMatchingContext<T : DeclarationSymbolMarker> : TypeSystemC
|
||||
dynamicTypesEqualToAnything: Boolean = true
|
||||
): Boolean
|
||||
|
||||
fun actualTypeIsSubtypeOfExpectType(
|
||||
expectType: KotlinTypeMarker,
|
||||
actualType: KotlinTypeMarker
|
||||
fun isSubtypeOf(
|
||||
superType: KotlinTypeMarker,
|
||||
subType: KotlinTypeMarker
|
||||
): Boolean
|
||||
|
||||
fun RegularClassSymbolMarker.isNotSamInterface(): Boolean
|
||||
|
||||
Reference in New Issue
Block a user