From 07a4352809cc5416dee9293ec2d56d635caa4ca1 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Tue, 26 Nov 2019 15:46:46 +0300 Subject: [PATCH] FIR: Add hack for Fir2IrVisitor See the comment --- .../kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 + } } } }