diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt index 66918611476..4114ae51806 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt @@ -240,7 +240,13 @@ class FirClassSubstitutionScope( } } - typeParameters += newTypeParameters ?: baseFunction.typeParameters + // TODO: Fix the hack for org.jetbrains.kotlin.fir.backend.Fir2IrVisitor.addFakeOverrides + // We might have added baseFunction.typeParameters in case new ones are null + // But it fails at org.jetbrains.kotlin.ir.AbstractIrTextTestCase.IrVerifier.elementsAreUniqueChecker + // because it shares the same declarations of type parameters between two different two functions + if (newTypeParameters != null) { + typeParameters += newTypeParameters + } } } }