[FIR] Fix mangling for generic class members ^KT-57429 Fixed ^KT-57433 Fixed
diff --git a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmMangleComputer.kt b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmMangleComputer.kt index d8af581..47773c2 100644 --- a/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmMangleComputer.kt +++ b/compiler/fir/fir2ir/jvm-backend/src/org/jetbrains/kotlin/fir/backend/jvm/FirJvmMangleComputer.kt
@@ -7,15 +7,12 @@ import org.jetbrains.kotlin.backend.common.serialization.mangle.MangleMode import org.jetbrains.kotlin.fir.backend.FirMangleComputer -import org.jetbrains.kotlin.fir.containingClassLookupTag -import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.declarations.FirDeclaration +import org.jetbrains.kotlin.fir.declarations.FirField +import org.jetbrains.kotlin.fir.declarations.FirFunction +import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction import org.jetbrains.kotlin.fir.java.declarations.FirJavaField -import org.jetbrains.kotlin.fir.originalForSubstitutionOverride -import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.resolve.providers.firProvider -import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider -import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag -import org.jetbrains.kotlin.fir.types.coneType /** * JVM backend-specific mangle computer that generates a mangled name for a Kotlin declaration represented by [FirDeclaration]. @@ -24,7 +21,7 @@ builder: StringBuilder, mode: MangleMode, ) : FirMangleComputer(builder, mode) { - override val visitor = JvmVisitor() + override val visitor: Visitor = JvmVisitor() override fun FirFunction.platformSpecificSuffix(): String? = if (this is FirSimpleFunction && name.asString() == "main") @@ -36,49 +33,7 @@ override fun copy(newMode: MangleMode): FirJvmMangleComputer = FirJvmMangleComputer(builder, newMode) - // FIXME this implementation causes the mangler to deliver different result than IR mangler. Consider using base method instead - override fun FirDeclaration.visitParent() { - val (parentPackageFqName, parentClassId) = when (this) { - is FirCallableDeclaration -> this.containingClassLookupTag()?.classId?.let { it.packageFqName to it } ?: return - is FirClassLikeDeclaration -> this.symbol.classId.let { it.packageFqName to it.outerClassId } - else -> return - } - if (parentClassId != null && !parentClassId.isLocal) { - val parentClassLike = this.moduleData.session.symbolProvider.getClassLikeSymbolByClassId(parentClassId)?.fir - ?: error("Attempt to find parent ($parentClassId) for probably-local declaration!") - if (parentClassLike is FirRegularClass || parentClassLike is FirTypeAlias) { - parentClassLike.visit() - } else { - error("Strange class-like declaration: ${parentClassLike.render()}") - } - } else if (parentClassId == null && !parentPackageFqName.isRoot) { - builder.appendName(parentPackageFqName.asString()) - } - } - - // FIXME this implementation causes the mangler to deliver different result than IR mangler. Consider using base method instead - override fun getEffectiveParent(typeParameter: ConeTypeParameterLookupTag): FirMemberDeclaration = typeParameter.symbol.fir.run { - - fun FirTypeParameter.sameAs(other: FirTypeParameter) = - this === other || - (name == other.name && bounds.size == other.bounds.size && - bounds.zip(other.bounds).all { it.first.coneType == it.second.coneType }) - - for (parent in typeParameterContainers) { - if (parent.typeParameters.any { this.sameAs(it.symbol.fir) }) { - return parent - } - if (parent is FirCallableDeclaration) { - val overriddenFir = parent.originalForSubstitutionOverride - if (overriddenFir is FirTypeParametersOwner && overriddenFir.typeParameters.any { this.sameAs(it) }) { - return parent - } - } - } - throw IllegalStateException("Should not be here!") - } - - protected inner class JvmVisitor : Visitor() { + private inner class JvmVisitor : Visitor() { override fun visitField(field: FirField) { if (field is FirJavaField) { field.mangleSimpleDeclaration(field.name.asString())
diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt index 08e7f6a..48d31c5 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/FirMangleComputer.kt
@@ -107,9 +107,25 @@ override fun isUnit(type: ConeKotlinType) = type.isUnit - @OptIn(SymbolInternals::class) override fun getEffectiveParent(typeParameter: ConeTypeParameterLookupTag): FirMemberDeclaration = typeParameter.symbol.fir.run { - this.containingDeclarationSymbol.fir as FirMemberDeclaration + + fun FirTypeParameter.sameAs(other: FirTypeParameter) = + this === other || + (name == other.name && bounds.size == other.bounds.size && + bounds.zip(other.bounds).all { it.first.coneType == it.second.coneType }) + + for (parent in typeParameterContainers) { + if (parent.typeParameters.any { it is FirTypeParameter && this.sameAs(it) }) { + return parent + } + if (parent is FirCallableDeclaration) { + val overriddenFir = parent.originalForSubstitutionOverride + if (overriddenFir is FirTypeParametersOwner && overriddenFir.typeParameters.any { this.sameAs(it) }) { + return parent + } + } + } + throw IllegalStateException("Should not be here!") } override fun renderDeclaration(declaration: FirDeclaration) = declaration.render()
diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt index 8d2d71e..6d66563 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassWithArrayMembers.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - data class Test1( val stringArray: Array<String>, val charArray: CharArray,
diff --git a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt index 0d47797..4c25863 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt +++ b/compiler/testData/ir/irText/classes/dataClasses/dataClassesGeneric.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - data class Test1<T>(val x: T) data class Test2<T : Number>(val x: T)
diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt index cf4c3dc..c5be7be 100644 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - open class Cell<T>(val value: T) typealias CT<T> = Cell<T>
diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt index ab8dd9e..2df1de5 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.kt
@@ -1,8 +1,5 @@ // !LANGUAGE: +InlineClasses -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class C<T>(val t: T) { override fun hashCode(): Int = t as Int }
diff --git a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt index 7aa6eea..b95f620 100644 --- a/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt +++ b/compiler/testData/ir/irText/declarations/annotations/genericAnnotationClasses.kt
@@ -1,5 +1,5 @@ // SKIP_SIGNATURE_DUMP -// ^ KT-57429, different types in annotations generated by K1 and K2 +// ^ different types in annotations generated by K1 and K2 package ann
diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt index dec4d37..d84093d 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/fromKEEP/compareTo.kt
@@ -1,9 +1,6 @@ // !LANGUAGE: +ContextReceivers // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - data class Pair<A, B>(val first: A, val second: B) context(Comparator<T>)
diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt index 86c976f..be62583 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.kt
@@ -1,13 +1,6 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers -// IGNORE_BACKEND_K1: JS_IR -// IGNORE_BACKEND_K1: JS_IR_ES6 - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - - context(T) class A<T> context(Collection<P>) class B<P>
diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt index 38461a3..5ebcf8a 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/genericOuterClass.sig.kt.txt
@@ -6,9 +6,12 @@ // Mangled name: A#<init>!1:0(){} // Public signature: /A.<init>|5547349096232763669[0] constructor($context_receiver_0: T) /* primary */ - // CHECK: + // CHECK JVM_IR: // Mangled name computed from Ir: A.contextReceiverField0 // Mangled name computed from Descriptor: A{}contextReceiverField0#jf + // CHECK JS_IR NATIVE: + // Mangled name computed from Ir: A.contextReceiverField0 + // Mangled name computed from Descriptor: A{}contextReceiverField0 private /* final field */ val contextReceiverField0: T } @@ -21,9 +24,12 @@ // Mangled name: B#<init>!kotlin.collections.Collection<1:0>(){} // Public signature: /B.<init>|-5453957848603821578[0] constructor($context_receiver_0: Collection<P>) /* primary */ - // CHECK: + // CHECK JVM_IR: // Mangled name computed from Ir: B.contextReceiverField0 // Mangled name computed from Descriptor: B{}contextReceiverField0#jf + // CHECK JS_IR NATIVE: + // Mangled name computed from Ir: B.contextReceiverField0 + // Mangled name computed from Descriptor: B{}contextReceiverField0 private /* final field */ val contextReceiverField0: Collection<P> }
diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt index f99d215..041c2ec 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.kt
@@ -1,10 +1,5 @@ // FIR_IDENTICAL // !LANGUAGE: +ContextReceivers -// IGNORE_BACKEND_K1: JS_IR -// IGNORE_BACKEND_K1: JS_IR_ES6 - -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 class A<T>(val a: T) class B(val b: Any)
diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt index 4792aab..ded32cd 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/thisWithCustomLabel.sig.kt.txt
@@ -9,6 +9,9 @@ // CHECK JVM_IR: // Mangled name: A#<get-a>(){}1:0 // Public signature: /A.a.<get-a>|5765441560292063424[0] + // CHECK JS_IR: + // Mangled name: A#<get-a>(){} + // Public signature: /A.a.<get-a>|6785176174175479410[0] get // CHECK: @@ -29,6 +32,9 @@ // CHECK JVM_IR: // Mangled name: B#<get-b>(){}kotlin.Any // Public signature: /B.b.<get-b>|4768115582956424363[0] + // CHECK JS_IR: + // Mangled name: B#<get-b>(){} + // Public signature: /B.b.<get-b>|812004636995167743[0] get // CHECK: @@ -49,6 +55,9 @@ // CHECK JVM_IR: // Mangled name: C#<get-c>(){}kotlin.Any // Public signature: /C.c.<get-c>|-7073232512849879703[0] + // CHECK JS_IR: + // Mangled name: C#<get-c>(){} + // Public signature: /C.c.<get-c>|2368736057102379596[0] get // CHECK: @@ -70,5 +79,8 @@ // CHECK JVM_IR: // Mangled name: #<get-p>!A<kotlin.Int>!A<kotlin.String>!B@C(){}kotlin.Int // Public signature: /p.<get-p>|-7725362510645392909[0] + // CHECK JS_IR: + // Mangled name: #<get-p>!A<kotlin.Int>!A<kotlin.String>!B@C(){} + // Public signature: /p.<get-p>|-2698360468898936971[0] get($context_receiver_0: A<Int>, $context_receiver_1: A<String>, $context_receiver_2: B): Int
diff --git a/compiler/testData/ir/irText/declarations/kt45308.kt b/compiler/testData/ir/irText/declarations/kt45308.kt index 3d7f4d3ae..5550947 100644 --- a/compiler/testData/ir/irText/declarations/kt45308.kt +++ b/compiler/testData/ir/irText/declarations/kt45308.kt
@@ -2,9 +2,6 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57433 - // MODULE: a // FILE: a.kt package a
diff --git a/compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt b/compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt index 625515b..4d0efb6 100644 --- a/compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt45308.sig.kt.txt
@@ -13,6 +13,9 @@ // CHECK JVM_IR: // Mangled name: b#foo(kotlin.Function0<kotlin.String>){}kotlin.String // Public signature: b/foo|-5020381652845254261[0] +// CHECK JS_IR NATIVE: +// Mangled name: b#foo(kotlin.Function0<kotlin.String>){} +// Public signature: b/foo|-2695324588787180624[0] fun foo(f: Function0<String>): String // MODULE: c @@ -21,5 +24,8 @@ // CHECK JVM_IR: // Mangled name: #box(){}kotlin.String // Public signature: /box|-9347091776561469[0] +// CHECK JS_IR NATIVE: +// Mangled name: #box(){} +// Public signature: /box|2173511048851971368[0] fun box(): String
diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.kt b/compiler/testData/ir/irText/declarations/parameters/constructor.kt index d6c8922..25091a4 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.kt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class Test1<T1, T2>(val x: T1, val y: T2) class Test2(x: Int, val y: String) {
diff --git a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt index 482d9c3..124a750 100644 --- a/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt +++ b/compiler/testData/ir/irText/declarations/parameters/dataClassMembers.kt
@@ -1,7 +1,4 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - data class Test<T>(val x: T, val y: String = "")
diff --git a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt index a58e697..75e70c5 100644 --- a/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt +++ b/compiler/testData/ir/irText/declarations/parameters/defaultPropertyAccessors.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - val test1 = 42 var test2 = 42
diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt index e07aeab..bd40076 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.kt
@@ -1,5 +1,5 @@ // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57754, KT-57429 +// ^ KT-57754 interface IBase<T> { fun foo(x: Int)
diff --git a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt index b5541f7..b500b1d 100644 --- a/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt +++ b/compiler/testData/ir/irText/declarations/parameters/genericInnerClass.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class Outer<T1> { inner class Inner<T2> { fun foo(x1: T1, x2: T2) {}
diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt index 1bf5f96..46a4300 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.kt
@@ -2,9 +2,6 @@ // TARGET_BACKEND: JVM // SKIP_KT_DUMP -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57433 - // FILE: box.kt package k
diff --git a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt index f7f2bd7..de7d155 100644 --- a/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt +++ b/compiler/testData/ir/irText/expressions/ambiguousFieldAccess.kt
@@ -2,9 +2,6 @@ // SKIP_KLIB_TEST // Related to KT-49507 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57433 - // FILE: A.java public class A { protected String x = "1";
diff --git a/compiler/testData/ir/irText/expressions/builtinOperators.kt b/compiler/testData/ir/irText/expressions/builtinOperators.kt index 57087f3..dc62884 100644 --- a/compiler/testData/ir/irText/expressions/builtinOperators.kt +++ b/compiler/testData/ir/irText/expressions/builtinOperators.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57433 - // FILE: test.kt package test
diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt index 60f7e41..3282a8c 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInlineAdaptedReference.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57433 - package test inline fun foo(x: () -> Unit) {}
diff --git a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt index dc782ef..b6b3053b 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/boundInnerGenericConstructor.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57433, KT-57429 - package test class Foo<T> {
diff --git a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt index 089f274..24ee949 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/genericLocalClassConstructorReference.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - open class L<LL>(val ll: LL) class Rec<T>(val rt: T)
diff --git a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt index dc84100..3898f79 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt +++ b/compiler/testData/ir/irText/expressions/callableReferences/importedFromObject.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57433 - package test import test.Foo.a
diff --git a/compiler/testData/ir/irText/expressions/funImportedFromObject.kt b/compiler/testData/ir/irText/expressions/funImportedFromObject.kt index 907c3e3..575fc1b 100644 --- a/compiler/testData/ir/irText/expressions/funImportedFromObject.kt +++ b/compiler/testData/ir/irText/expressions/funImportedFromObject.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57433 - package test import test.Host.foo
diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt index 4112b7a..a36017a 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.kt
@@ -1,9 +1,6 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - fun testSimple() = Box<Long>(2L * 3) inline fun <reified T> testArray(n: Int, crossinline block: () -> T): Array<T> {
diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt index 6bafedb..8914b72 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.kt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class Value<T>(var value: T = null as T, var text: String? = null) val <T> Value<T>.additionalText by DVal(Value<T>::text)
diff --git a/compiler/testData/ir/irText/expressions/kt36956.kt b/compiler/testData/ir/irText/expressions/kt36956.kt index a09bb7b..2216389 100644 --- a/compiler/testData/ir/irText/expressions/kt36956.kt +++ b/compiler/testData/ir/irText/expressions/kt36956.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class A<T>(private val value: T) { operator fun get(i: Int) = value operator fun set(i: Int, v: T) {}
diff --git a/compiler/testData/ir/irText/expressions/kt44993.kt b/compiler/testData/ir/irText/expressions/kt44993.kt index fdc22da..aaed2cc 100644 --- a/compiler/testData/ir/irText/expressions/kt44993.kt +++ b/compiler/testData/ir/irText/expressions/kt44993.kt
@@ -3,9 +3,6 @@ // WITH_STDLIB // SKIP_KT_DUMP -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - // FILE: kt44993.kt fun f(r: KotlinBox<JavaBox>): String = r?.data?.element!!
diff --git a/compiler/testData/ir/irText/expressions/kt47328.kt b/compiler/testData/ir/irText/expressions/kt47328.kt index d37d85c..34044a8 100644 --- a/compiler/testData/ir/irText/expressions/kt47328.kt +++ b/compiler/testData/ir/irText/expressions/kt47328.kt
@@ -6,9 +6,6 @@ // TARGET_BACKEND: JVM_IR // WITH_STDLIB -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - interface A { val x: Int } class B(@JvmField override val x: Int): A
diff --git a/compiler/testData/ir/irText/expressions/memberTypeArguments.kt b/compiler/testData/ir/irText/expressions/memberTypeArguments.kt index 63e4195..fab58d4 100644 --- a/compiler/testData/ir/irText/expressions/memberTypeArguments.kt +++ b/compiler/testData/ir/irText/expressions/memberTypeArguments.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class GenericClass<T>(val value: T) { fun withNewValue(newValue: T) = GenericClass(newValue) }
diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt index c0a3f95..8e9c807 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57433 - package test class C
diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt index e333369..822cf97 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionInGenericConstructorCall.kt
@@ -1,9 +1,6 @@ // FIR_IDENTICAL // TARGET_BACKEND: JVM -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - // FILE: samConversionInGenericConstructorCall.kt fun test3( f1: (String) -> String,
diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt index 352a0dd..57c0329 100644 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class Cell<T>(val value: T) typealias IntAlias = Cell<Int>
diff --git a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt index 7b096d2..8e664e0 100644 --- a/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt +++ b/compiler/testData/ir/irText/expressions/thisOfGenericOuterClass.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class Outer<T>(val x: T) { open inner class Inner(val y: Int) }
diff --git a/compiler/testData/ir/irText/firProblems/ArrayMap.kt b/compiler/testData/ir/irText/firProblems/ArrayMap.kt index 35ee41d..55955fb 100644 --- a/compiler/testData/ir/irText/firProblems/ArrayMap.kt +++ b/compiler/testData/ir/irText/firProblems/ArrayMap.kt
@@ -3,9 +3,6 @@ // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - sealed class ArrayMap<T : Any> : Iterable<T> { abstract val size: Int
diff --git a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt index 5df97a5..c047e98 100644 --- a/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt +++ b/compiler/testData/ir/irText/firProblems/ClashResolutionDescriptor.kt
@@ -3,7 +3,7 @@ // WITH_STDLIB // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 +// ^ KT-57778 import java.lang.reflect.Type
diff --git a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt index 36903ae..a308de1 100644 --- a/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt +++ b/compiler/testData/ir/irText/firProblems/ImplicitReceiverStack.kt
@@ -5,7 +5,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429, KT-57788 +// ^ KT-57788 interface SymbolOwner<E : SymbolOwner<E>>
diff --git a/compiler/testData/ir/irText/firProblems/OutBox.kt b/compiler/testData/ir/irText/firProblems/OutBox.kt index 77994dd..fe84980 100644 --- a/compiler/testData/ir/irText/firProblems/OutBox.kt +++ b/compiler/testData/ir/irText/firProblems/OutBox.kt
@@ -1,8 +1,5 @@ // TARGET_BACKEND: JVM -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - // FILE: Foo.java public class Foo {
diff --git a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt index bb7a889..ff1950b 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt +++ b/compiler/testData/ir/irText/firProblems/SignatureComputationComplexJavaGeneric.kt
@@ -1,8 +1,5 @@ // TARGET_BACKEND: JVM_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - // FILE: J.java import org.jetbrains.annotations.Nullable;
diff --git a/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt b/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt index 8ab4ee2..20f970e 100644 --- a/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt +++ b/compiler/testData/ir/irText/firProblems/TypeParameterInNestedClass.kt
@@ -1,8 +1,4 @@ // ISSUE: KT-58008 - -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - object Retry { class Builder<B>( private val action: suspend () -> B,
diff --git a/compiler/testData/ir/irText/firProblems/kt43342.kt b/compiler/testData/ir/irText/firProblems/kt43342.kt index cd7eb242..2ddee9d 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.kt +++ b/compiler/testData/ir/irText/firProblems/kt43342.kt
@@ -2,9 +2,6 @@ // IGNORE_BACKEND_K2: JS_IR // IGNORE_BACKEND_K2: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - open class ControlFlowInfo<K, V>(val map: Map<K, V>): Map<K, V> by map class StringFlowInfo(map: Map<String, String>): ControlFlowInfo<String, String>(map) {
diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt index 70fddc5..a8e0338 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt
@@ -3,7 +3,7 @@ // DUMP_LOCAL_DECLARATION_SIGNATURES // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429, KT-57430 +// ^ KT-57430 import kotlin.properties.ReadWriteProperty import kotlin.reflect.KClass
diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt b/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt index 15a20e5..25f24e6 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastFromDynamic.kt
@@ -1,9 +1,6 @@ // TARGET_BACKEND: JS_IR // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57818 - val d: dynamic = 1 val p: Int = d
diff --git a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt index 809d65d..bceee43 100644 --- a/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt +++ b/compiler/testData/ir/irText/js/dynamic/implicitCastToDynamic.kt
@@ -1,8 +1,5 @@ // TARGET_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57818 - val d1: dynamic = 1 val p: Int = 1
diff --git a/compiler/testData/ir/irText/regressions/kt45236.kt b/compiler/testData/ir/irText/regressions/kt45236.kt index 8d8b7de..d9f7b23 100644 --- a/compiler/testData/ir/irText/regressions/kt45236.kt +++ b/compiler/testData/ir/irText/regressions/kt45236.kt
@@ -2,9 +2,6 @@ // SKIP_KT_DUMP // TARGET_BACKEND: JVM_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - import kotlin.contracts.ExperimentalContracts import kotlin.contracts.contract
diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt index 18a328a..a4b34cf 100644 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt
@@ -1,6 +1,3 @@ -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - class A<Q>(val q: Q) typealias B<X> = A<X>
diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt index 506318a8..5b6c5f3 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.kt
@@ -1,9 +1,6 @@ // IGNORE_BACKEND_K1: JS_IR // IGNORE_BACKEND_K1: JS_IR_ES6 -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - // MODULE: m1 // FILE: genericClassInDifferentModule_m1.kt
diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt index 4c8df6c..f9283fd 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule.sig.kt.txt
@@ -78,6 +78,9 @@ // CHECK JVM_IR: // Mangled name: Derived1#<get-bar>(){}1:0 // Public signature: /Derived1.bar.<get-bar>|7899956589744407340[0] + // CHECK JS_IR NATIVE: + // Mangled name: Derived1#<get-bar>(){} + // Public signature: /Derived1.bar.<get-bar>|6880642144337645699[0] override get // CHECK: // Mangled name: Derived1#<set-bar>(1:0){} @@ -92,6 +95,9 @@ // CHECK JVM_IR: // Mangled name: Derived1#foo(0:0){0§<kotlin.Any?>}1:0 // Public signature: /Derived1.foo|8673945311830780726[0] + // CHECK JS_IR NATIVE: + // Mangled name: Derived1#foo(0:0){0§<kotlin.Any?>} + // Public signature: /Derived1.foo|-6838606926256314363[0] override fun <Y : Any?> foo(y: Y): T // CHECK: @@ -101,6 +107,9 @@ // CHECK JVM_IR: // Mangled name: Derived1#<get-x>(){}1:0 // Public signature: /Derived1.x.<get-x>|-8893883356128097563[0] + // CHECK JS_IR NATIVE: + // Mangled name: Derived1#<get-x>(){} + // Public signature: /Derived1.x.<get-x>|1482705010654679335[0] /* fake */ override get(): T // CHECK: @@ -110,6 +119,9 @@ // CHECK JVM_IR: // Mangled name: Derived1#<get-exn>@0:0(){0§<kotlin.Any?>}1:0 // Public signature: /Derived1.exn.<get-exn>|6217753676739394662[0] + // CHECK JS_IR NATIVE: + // Mangled name: Derived1#<get-exn>@0:0(){0§<kotlin.Any?>} + // Public signature: /Derived1.exn.<get-exn>|-202876889853335253[0] override get(): T // CHECK: // Mangled name: Derived1#<set-exn>@0:0(1:0){0§<kotlin.Any?>}
diff --git a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt index efd812b..7d04e6e 100644 --- a/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt +++ b/compiler/testData/ir/irText/types/castsInsideCoroutineInference.kt
@@ -3,7 +3,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429, KT-57778 +// ^ KT-57778 import kotlin.experimental.ExperimentalTypeInference
diff --git a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt index a431106..7af84af 100644 --- a/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt +++ b/compiler/testData/ir/irText/types/definitelyNotNullAsArgument.kt
@@ -1,8 +1,5 @@ //!LANGUAGE: +DefinitelyNonNullableTypes -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - interface I<T> { fun input(t: T) fun output(): T
diff --git a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt index 7543e74..f0b1eae 100644 --- a/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt +++ b/compiler/testData/ir/irText/types/dontLeaveStubTypesInSetter.kt
@@ -4,7 +4,7 @@ // IGNORE_BACKEND: JS_IR_ES6 // MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429, KT-57755 +// ^ KT-57755 class Foo<T>(var x: T)
diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt index 27c49de..f251db3 100644 --- a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt
@@ -1,8 +1,5 @@ // !LANGUAGE: -ForbidUsingExtensionPropertyTypeParameterInDelegate -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - import kotlin.reflect.KProperty1 import kotlin.reflect.KMutableProperty1 import kotlin.reflect.KProperty
diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt index 5c941bc..3acdaee 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429, KT-57427 - import kotlin.reflect.KMutableProperty class C<T>(var x: T)
diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt index 53200da..b7bcb4c 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInDestructuringAssignment.kt
@@ -1,9 +1,6 @@ // TARGET_BACKEND: JVM // WITH_STDLIB -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - // FILE: enhancedNullabilityInDestructuringAssignment.kt fun use(x: Any, y: Any) {}
diff --git a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt index 71b87d1..d9b7c44 100644 --- a/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt +++ b/compiler/testData/ir/irText/types/smartCastOnReceiverOfGenericType.kt
@@ -1,8 +1,5 @@ // FIR_IDENTICAL -// MUTE_SIGNATURE_COMPARISON_K2: JVM_IR -// ^ KT-57429 - fun testFunction(a: Any, b: Any) { a as MutableList<String> b as String
diff --git a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt index 838019c..d7c7b42 100644 --- a/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt +++ b/compiler/testData/ir/irText/types/typeAliasWithUnsafeVariance.kt
@@ -1,9 +1,6 @@ // KT-42036 // IGNORE_BACKEND: JS_IR -// MUTE_SIGNATURE_COMPARISON_K2: ANY -// ^ KT-57429 - typealias Action<RenderingT> = (@UnsafeVariance RenderingT) -> Unit data class Tag<out RenderingT>(val action: Action<RenderingT>)