diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/TypeExpansionUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/TypeExpansionUtils.kt index 5e446b4ed85..7f8cd218a8c 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/TypeExpansionUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/TypeExpansionUtils.kt @@ -71,6 +71,9 @@ private fun mapTypeAliasArguments( abbreviatedType: ConeClassLikeType, resultingType: ConeClassLikeType, ): 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 substitutor = object : AbstractConeSubstitutor() { diff --git a/compiler/testData/codegen/box/super/basicmethodSuperClass.kt b/compiler/testData/codegen/box/super/basicmethodSuperClass.kt index e963fbf6853..4165898b355 100644 --- a/compiler/testData/codegen/box/super/basicmethodSuperClass.kt +++ b/compiler/testData/codegen/box/super/basicmethodSuperClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // IGNORE_BACKEND: NATIVE diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorInferenceInSupertypesList.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorInferenceInSupertypesList.fir.kt index cc45ddb92e4..9633af61203 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorInferenceInSupertypesList.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorInferenceInSupertypesList.fir.kt @@ -3,5 +3,5 @@ open class Ref(var x: T) typealias R = Ref // Type inference SHOULD NOT work for type alias constructor in supertypes list -class Test1 : R(0) +class Test1 : R(0) class Test2 : R(0)