[FIR] Keep bare type for type alias case
This commit is contained in:
@@ -71,6 +71,9 @@ private fun mapTypeAliasArguments(
|
|||||||
abbreviatedType: ConeClassLikeType,
|
abbreviatedType: ConeClassLikeType,
|
||||||
resultingType: ConeClassLikeType,
|
resultingType: ConeClassLikeType,
|
||||||
): ConeKotlinType {
|
): ConeKotlinType {
|
||||||
|
if (typeAlias.typeParameters.isNotEmpty() && abbreviatedType.typeArguments.isEmpty()) {
|
||||||
|
return resultingType.lookupTag.constructClassType(emptyArray(), resultingType.isNullable)
|
||||||
|
}
|
||||||
val typeAliasMap = typeAlias.typeParameters.map { it.symbol }.zip(abbreviatedType.typeArguments).toMap()
|
val typeAliasMap = typeAlias.typeParameters.map { it.symbol }.zip(abbreviatedType.typeArguments).toMap()
|
||||||
|
|
||||||
val substitutor = object : AbstractConeSubstitutor() {
|
val substitutor = object : AbstractConeSubstitutor() {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
// IGNORE_BACKEND_FIR: JVM_IR
|
|
||||||
// KJS_WITH_FULL_RUNTIME
|
// KJS_WITH_FULL_RUNTIME
|
||||||
// IGNORE_BACKEND: NATIVE
|
// IGNORE_BACKEND: NATIVE
|
||||||
|
|
||||||
|
|||||||
Vendored
+1
-1
@@ -3,5 +3,5 @@ open class Ref<T>(var x: T)
|
|||||||
typealias R<T> = Ref<T>
|
typealias R<T> = Ref<T>
|
||||||
|
|
||||||
// Type inference SHOULD NOT work for type alias constructor in supertypes list
|
// Type inference SHOULD NOT work for type alias constructor in supertypes list
|
||||||
class Test1 : <!INAPPLICABLE_CANDIDATE!>R<!>(0)
|
class Test1 : R(0)
|
||||||
class Test2 : R<Int>(0)
|
class Test2 : R<Int>(0)
|
||||||
|
|||||||
Reference in New Issue
Block a user