From 00a70c51f0e484757a900b93074013cb577d8ac5 Mon Sep 17 00:00:00 2001 From: Denis Zharkov Date: Tue, 26 Nov 2019 18:50:16 +0300 Subject: [PATCH] FIR: Generate fake overrides always if there are type parameters See the comment --- .../kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt | 5 ++++- .../testData/resolve/expresssions/importedReceiver.txt | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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 c77209189f7..c867865869b 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 @@ -153,7 +153,10 @@ class FirClassSubstitutionScope( } } - if (!wereChangesInTypeParameters) return Pair(member.typeParameters, substitutor) + // TODO: Uncomment when problem from org.jetbrains.kotlin.fir.Fir2IrTextTestGenerated.Declarations.Parameters.testDelegatedMembers is gone + // The problem is that Fir2Ir thinks that type parameters in fake override are the same as for original + // While common Ir contracts expect them to be different + // if (!wereChangesInTypeParameters) return Pair(member.typeParameters, substitutor) return Pair(newTypeParameters, ChainedSubstitutor(substitutor, additionalSubstitutor)) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt b/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt index aeaad1fbb50..a906f437009 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt @@ -31,5 +31,5 @@ FILE: importedReceiver.kt this@R|/My|.R|/My.baz|() (this@R|/My|, Boolean(true)).R|/My.gau|() this@R|/Your|.R|/Your.wat|() - (this@R|/Your|, Boolean(false)).R|/Your.watwat|() + (this@R|/Your|, Boolean(false)).R|FakeOverride|() }