[FIR] Actualize expect nested classes in type arguments in expect actual
...checker. ^KT-31636
This commit is contained in:
committed by
Space Team
parent
cec644e9db
commit
d343e40ac5
+15
-2
@@ -365,10 +365,23 @@ class FirExpectActualMatchingContextImpl private constructor(
|
||||
if (this is ConeClassLikeType && classId?.isNestedClass == true) {
|
||||
val classSymbol = classId.toSymbol(actualSession)
|
||||
if (classSymbol is FirRegularClassSymbol && classSymbol.isExpect) {
|
||||
tryExpandExpectNestedClassActualizedViaTypealias(this, classSymbol)?.let { return it }
|
||||
tryExpandExpectNestedClassActualizedViaTypealias(this, classSymbol)?.let {
|
||||
return it.actualizeTypeArguments()
|
||||
}
|
||||
}
|
||||
}
|
||||
return fullyExpandedType(actualSession)
|
||||
return fullyExpandedType(actualSession).actualizeTypeArguments()
|
||||
}
|
||||
|
||||
private fun ConeKotlinType.actualizeTypeArguments(): ConeKotlinType {
|
||||
if (this !is ConeClassLikeType) {
|
||||
return this
|
||||
}
|
||||
return withArguments { arg ->
|
||||
if (arg is ConeKotlinTypeProjection) {
|
||||
arg.replaceType(arg.type.actualize()) as ConeTypeProjection
|
||||
} else arg
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -14,4 +14,4 @@ class FooImpl {
|
||||
}
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> = FooImpl
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
+1
-1
@@ -14,4 +14,4 @@ class FooImpl {
|
||||
}
|
||||
}
|
||||
|
||||
actual typealias <!NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS!>Foo<!> = FooImpl
|
||||
actual typealias Foo = FooImpl
|
||||
|
||||
Reference in New Issue
Block a user