diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt index 13e737a1283..535c3ff37ca 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/substitution/Substitutors.kt @@ -120,7 +120,11 @@ abstract class AbstractConeSubstitutor : ConeSubstitutor() { } fun substitutorByMap(substitution: Map): ConeSubstitutor { - if (substitution.isEmpty()) return ConeSubstitutor.Empty + // If all arguments match parameters, then substitutor isn't needed + if (substitution.all { (parameterSymbol, argumentType) -> + (argumentType as? ConeTypeParameterType)?.lookupTag?.typeParameterSymbol == parameterSymbol + } + ) return ConeSubstitutor.Empty return ConeSubstitutorByMap(substitution) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/genericUsedInFunction.txt b/compiler/fir/resolve/testData/resolve/expresssions/genericUsedInFunction.txt index 2929a1adacd..284a9885066 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/genericUsedInFunction.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/genericUsedInFunction.txt @@ -8,7 +8,7 @@ FILE: genericUsedInFunction.kt public get(): R|T| public final fun foo(): R|T| { - ^foo this@R|/Generic|.R|FakeOverride| + ^foo this@R|/Generic|.R|/Generic.value| } } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/protectedVisibility.txt b/compiler/fir/resolve/testData/resolve/expresssions/protectedVisibility.txt index 8edcf6d4704..469fb88b6ee 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/protectedVisibility.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/protectedVisibility.txt @@ -91,7 +91,7 @@ FILE: protectedVisibility.kt public get(): R|T| protected open fun foo(): R|T| { - ^foo this@R|/Generic|.R|FakeOverride| + ^foo this@R|/Generic|.R|/Generic.x| } } diff --git a/compiler/fir/resolve/testData/resolve/genericConstructors.txt b/compiler/fir/resolve/testData/resolve/genericConstructors.txt index a670b141f91..7ae06be73ea 100644 --- a/compiler/fir/resolve/testData/resolve/genericConstructors.txt +++ b/compiler/fir/resolve/testData/resolve/genericConstructors.txt @@ -13,7 +13,7 @@ FILE: genericConstructors.kt super() } - public final val myE: R|E| = this@R|/B|.R|FakeOverride|(R|/e|) + public final val myE: R|E| = this@R|/B|.R|/B.id|(R|/e|) public get(): R|E| public final val a: R|A| = R|/A.A|(R|/e|) diff --git a/compiler/fir/resolve/testData/resolve/problems2.txt b/compiler/fir/resolve/testData/resolve/problems2.txt index 869fdc94fcb..63a29a8a20a 100644 --- a/compiler/fir/resolve/testData/resolve/problems2.txt +++ b/compiler/fir/resolve/testData/resolve/problems2.txt @@ -9,7 +9,7 @@ FILE: problems2.kt } public final fun intern(obj: R|T|): R|kotlin/Int?| { - ^intern this@R|/Interner|.R|FakeOverride|(R|/obj|) + ^intern this@R|/Interner|.R|/Interner.find|(R|/obj|) } } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/hashTableWithForEach.txt b/compiler/fir/resolve/testData/resolveWithStdlib/hashTableWithForEach.txt index 6b5402c0120..4da94d184ca 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/hashTableWithForEach.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/hashTableWithForEach.txt @@ -14,7 +14,7 @@ FILE: hashTableWithForEach.kt when () { R|/DEBUG| -> { ^ Q|java/util/Collections|.R|java/util/Collections.unmodifiableSet|, kotlin/collections/MutableMap.MutableEntry?>!|>(R|kotlin/collections/mutableSetOf||>().R|kotlin/apply|>|>( = apply@fun R|kotlin/collections/MutableSet>|.(): R|kotlin/Unit| { - this@R|/SomeHashTable|.R|FakeOverride|( = forEach@fun (key: R|K|, value: R|V|): R|kotlin/Unit| { + this@R|/SomeHashTable|.R|/SomeHashTable.forEach|( = forEach@fun (key: R|K|, value: R|V|): R|kotlin/Unit| { ^ this@R|special/anonymous|.R|FakeOverride|(R|/SomeHashTable.Entry.Entry|(R|/key|, R|/value|)) } ) diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/StaticGenericMethod.txt b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/StaticGenericMethod.txt index c0fb95bdb4a..a3353d2d2c6 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/StaticGenericMethod.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/StaticGenericMethod.txt @@ -6,14 +6,14 @@ FILE: User.kt super() } - private final var settings: R|T| = this@R|/User|.R|FakeOverride|() + private final var settings: R|T| = this@R|/User|.R|/User.createSettings|() private get(): R|T| private set(value: R|T|): R|kotlin/Unit| protected abstract fun createSettings(): R|T| public final fun foo(): R|kotlin/Unit| { - this@R|/User|.R|FakeOverride| = Q|StaticOwner|.R|/StaticOwner.newInstance|!|>(this@R|/User|.R|FakeOverride|.R|kotlin/jvm/javaClass|) + this@R|/User|.R|/User.settings| = Q|StaticOwner|.R|/StaticOwner.newInstance|!|>(this@R|/User|.R|/User.settings|.R|kotlin/jvm/javaClass|) } } diff --git a/compiler/testData/codegen/box/arrays/kt238.kt b/compiler/testData/codegen/box/arrays/kt238.kt index 78d392730a1..71c935d5c9d 100644 --- a/compiler/testData/codegen/box/arrays/kt238.kt +++ b/compiler/testData/codegen/box/arrays/kt238.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun t1 () { val a1 = arrayOfNulls(1) a1[0] = "0" //ok diff --git a/compiler/testData/codegen/box/classes/privateToThis.kt b/compiler/testData/codegen/box/classes/privateToThis.kt index ad0eb8313d0..8905986a1f4 100644 --- a/compiler/testData/codegen/box/classes/privateToThis.kt +++ b/compiler/testData/codegen/box/classes/privateToThis.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A(init_o: I, private val init_k: I) { private val o: I = init_o private fun k(): I = init_k