diff --git a/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/klib/compilerPipeline.kt b/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/klib/compilerPipeline.kt index d91b29f10aa..2537827e7e1 100644 --- a/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/klib/compilerPipeline.kt +++ b/compiler/cli/cli-js/src/org/jetbrains/kotlin/cli/js/klib/compilerPipeline.kt @@ -251,8 +251,7 @@ fun transformFirToIr( inlineConstTracker = null, expectActualTracker = moduleStructure.compilerConfiguration[CommonConfigurationKeys.EXPECT_ACTUAL_TRACKER], allowNonCachedDeclarations = false, - useIrFakeOverrideBuilder = - moduleStructure.compilerConfiguration.getBoolean(CommonConfigurationKeys.USE_IR_FAKE_OVERRIDE_BUILDER), + useIrFakeOverrideBuilder = true ), IrGenerationExtension.getInstances(moduleStructure.project), signatureComposer = DescriptorSignatureComposerStub(JsManglerDesc), diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java index f438892f6c3..3716d33c645 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java @@ -280,6 +280,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java index b900e390129..a4567ab3465 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java @@ -280,6 +280,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt index e94b2444573..76c463b2557 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt @@ -84,7 +84,8 @@ FILE fqName: fileName:/delegationInSealed.kt c: GET_VAR 'c: kotlin.CharSequence declared in .A.B.copy' type=kotlin.CharSequence origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.String overridden: - public open fun toString (): kotlin.String declared in kotlin.Any + public open fun toString (): kotlin.String declared in .A + public open fun toString (): kotlin.String declared in kotlin.CharSequence $this: VALUE_PARAMETER name: type:.A.B BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A.B' @@ -96,7 +97,8 @@ FILE fqName: fileName:/delegationInSealed.kt CONST String type=kotlin.String value=")" FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A.B) returnType:kotlin.Int overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any + public open fun hashCode (): kotlin.Int declared in .A + public open fun hashCode (): kotlin.Int declared in kotlin.CharSequence $this: VALUE_PARAMETER name: type:.A.B BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A.B' @@ -105,7 +107,8 @@ FILE fqName: fileName:/delegationInSealed.kt receiver: GET_VAR ': .A.B declared in .A.B.hashCode' type=.A.B origin=null FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A.B, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.CharSequence $this: VALUE_PARAMETER name: type:.A.B VALUE_PARAMETER name:other index:0 type:kotlin.Any? BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt index 2c531a32e60..770a36f1a6a 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.kt @@ -2,6 +2,10 @@ // SKIP_KLIB_TEST // IGNORE_BACKEND_K1: JS_IR +// KT-64271 +// IGNORE_BACKEND_K2: JVM_IR + + sealed class A : CharSequence { data class B(val c: CharSequence) : A(), CharSequence by c } diff --git a/compiler/testData/ir/irText/classes/enumClassModality.kt b/compiler/testData/ir/irText/classes/enumClassModality.kt index 7096f0638fd..01227fd5025 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.kt +++ b/compiler/testData/ir/irText/classes/enumClassModality.kt @@ -1,3 +1,6 @@ +// KT-64271, KT-64382 +// IGNORE_BACKEND_K2: NATIVE, WASM, JS_IR, JS_IR_ES6 + enum class TestFinalEnum1 { X1 } diff --git a/compiler/testData/ir/irText/classes/overriddenEquals.ir.txt b/compiler/testData/ir/irText/classes/overriddenEquals.ir.txt new file mode 100644 index 00000000000..d2e758916d6 --- /dev/null +++ b/compiler/testData/ir/irText/classes/overriddenEquals.ir.txt @@ -0,0 +1,84 @@ +FILE fqName: fileName:/overriddenEquals.kt + CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base + CONSTRUCTOR visibility:public <> () returnType:.Base [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Base modality:OPEN visibility:public superTypes:[kotlin.Any]' + FUN name:equals visibility:public modality:OPEN <> ($this:.Base, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Base' + CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ + arg0: GET_VAR ': .Base declared in .Base.equals' type=.Base origin=null + arg1: GET_VAR 'other: kotlin.Any? declared in .Base.equals' type=kotlin.Any? origin=null + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Child1 modality:FINAL visibility:public superTypes:[.Base; .I] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Child1 + CONSTRUCTOR visibility:public <> () returnType:.Child1 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child1 modality:FINAL visibility:public superTypes:[.Base; .I]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:.Base, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Base + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .I + $this: VALUE_PARAMETER name: type:.Base + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .Base + public open fun hashCode (): kotlin.Int declared in .I + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .Base + public open fun toString (): kotlin.String declared in .I + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:Child2 modality:FINAL visibility:public superTypes:[.I; .Base] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Child2 + CONSTRUCTOR visibility:public <> () returnType:.Child2 [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .Base' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Child2 modality:FINAL visibility:public superTypes:[.I; .Base]' + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .I + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in .I + public open fun hashCode (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in .I + public open fun toString (): kotlin.String declared in .Base + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/overriddenEquals.kt b/compiler/testData/ir/irText/classes/overriddenEquals.kt new file mode 100644 index 00000000000..897a54e2622 --- /dev/null +++ b/compiler/testData/ir/irText/classes/overriddenEquals.kt @@ -0,0 +1,16 @@ +// FIR_IDENTICAL +// KT-64271 +// IGNORE_BACKEND_K2: JVM_IR + +open class Base { + override fun equals(other: Any?): Boolean { + return this === other + } +} + +interface I { + +} + +class Child1 : Base(), I +class Child2 : I, Base() \ No newline at end of file diff --git a/compiler/testData/ir/irText/classes/overriddenEquals.kt.txt b/compiler/testData/ir/irText/classes/overriddenEquals.kt.txt new file mode 100644 index 00000000000..9e3d7620d42 --- /dev/null +++ b/compiler/testData/ir/irText/classes/overriddenEquals.kt.txt @@ -0,0 +1,33 @@ +open class Base { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + override operator fun equals(other: Any?): Boolean { + return EQEQEQ(arg0 = , arg1 = other) + } + +} + +interface I { +} + +class Child1 : Base, I { + constructor() /* primary */ { + super/*Base*/() + /* () */ + + } + +} + +class Child2 : I, Base { + constructor() /* primary */ { + super/*Base*/() + /* () */ + + } + +} diff --git a/compiler/testData/ir/irText/classes/overriddenEquals.sig.kt.txt b/compiler/testData/ir/irText/classes/overriddenEquals.sig.kt.txt new file mode 100644 index 00000000000..076762d41a4 --- /dev/null +++ b/compiler/testData/ir/irText/classes/overriddenEquals.sig.kt.txt @@ -0,0 +1,72 @@ +// CHECK: +// Mangled name: Base +// Public signature: /Base|null[0] +open class Base { + // CHECK: + // Mangled name: Base#(){} + // Public signature: /Base.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Base#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Base.equals|722809408929142791[0] + // Public signature debug description: equals(kotlin.Any?){}kotlin.Boolean + // CHECK JS_IR NATIVE: + // Mangled name: Base#equals(kotlin.Any?){} + // Public signature: /Base.equals|4638265728071529943[0] + // Public signature debug description: equals(kotlin.Any?){} + override operator fun equals(other: Any?): Boolean + +} + +// CHECK: +// Mangled name: Child1 +// Public signature: /Child1|null[0] +class Child1 : Base, I { + // CHECK: + // Mangled name: Child1#(){} + // Public signature: /Child1.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Child1#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Child1.equals|722809408929142791[0] + // Public signature debug description: equals(kotlin.Any?){}kotlin.Boolean + // CHECK JS_IR NATIVE: + // Mangled name: Child1#equals(kotlin.Any?){} + // Public signature: /Child1.equals|4638265728071529943[0] + // Public signature debug description: equals(kotlin.Any?){} + /* fake */ override operator fun equals(other: Any?): Boolean + +} + +// CHECK: +// Mangled name: Child2 +// Public signature: /Child2|null[0] +class Child2 : Base, I { + // CHECK: + // Mangled name: Child2#(){} + // Public signature: /Child2.|-5645683436151566731[0] + // Public signature debug description: (){} + constructor() /* primary */ + + // CHECK JVM_IR: + // Mangled name: Child2#equals(kotlin.Any?){}kotlin.Boolean + // Public signature: /Child2.equals|722809408929142791[0] + // Public signature debug description: equals(kotlin.Any?){}kotlin.Boolean + // CHECK JS_IR NATIVE: + // Mangled name: Child2#equals(kotlin.Any?){} + // Public signature: /Child2.equals|4638265728071529943[0] + // Public signature debug description: equals(kotlin.Any?){} + /* fake */ override operator fun equals(other: Any?): Boolean + +} + +// CHECK: +// Mangled name: I +// Public signature: /I|null[0] +interface I { +} + diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt deleted file mode 100644 index 4c2f30811de..00000000000 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.ir.txt +++ /dev/null @@ -1,249 +0,0 @@ -FILE fqName: fileName:/inlineCollectionOfInlineClass.kt - CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IT - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.IT [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IT modality:FINAL visibility:public [value] superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.Int declared in .IT.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IT) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IT' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IT declared in .IT.' type=.IT origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .IT' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="IT(" - CONST String type=kotlin.String value="x=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IT declared in .IT.toString' type=.IT origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.IT) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .IT' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IT declared in .IT.hashCode' type=.IT origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.IT, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.IT - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - BLOCK_BODY - WHEN type=kotlin.Unit origin=null - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.IT - GET_VAR 'other: kotlin.Any? declared in .IT.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IT' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.IT [val] - TYPE_OP type=.IT origin=CAST typeOperand=.IT - GET_VAR 'other: kotlin.Any? declared in .IT.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IT declared in .IT.equals' type=.IT origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR 'val tmp_0: .IT declared in .IT.equals' type=.IT origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IT' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IT' - CONST Boolean type=kotlin.Boolean value=true - CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<.IT>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.InlineMutableSet - CONSTRUCTOR visibility:public <> (ms:kotlin.collections.MutableSet<.IT>) returnType:.InlineMutableSet [primary] - VALUE_PARAMETER name:ms index:0 type:kotlin.collections.MutableSet<.IT> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:InlineMutableSet modality:FINAL visibility:public [value] superTypes:[kotlin.collections.MutableSet<.IT>]' - PROPERTY name:ms visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'ms: kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet.' type=kotlin.collections.MutableSet<.IT> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.InlineMutableSet) returnType:kotlin.collections.MutableSet<.IT> - correspondingProperty: PROPERTY name:ms visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.' type=.InlineMutableSet origin=null - PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract size: kotlin.Int - FUN name: visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Int - correspondingProperty: PROPERTY name:size visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .InlineMutableSet' - CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.MutableSet' type=kotlin.Int origin=GET_PROPERTY - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.' type=.InlineMutableSet origin=null - FUN name:contains visibility:public modality:OPEN <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean [operator] - overridden: - public abstract fun contains (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:element index:0 type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun contains (element: .IT): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun contains (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.contains' type=.InlineMutableSet origin=null - element: GET_VAR 'element: .IT declared in .InlineMutableSet.contains' type=.IT origin=null - FUN name:containsAll visibility:public modality:OPEN <> ($this:.InlineMutableSet, elements:kotlin.collections.Collection<.IT>) returnType:kotlin.Boolean - overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.IT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun containsAll (elements: kotlin.collections.Collection<.IT>): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.containsAll' type=.InlineMutableSet origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.containsAll' type=kotlin.collections.Collection<.IT> origin=null - FUN name:isEmpty visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Boolean - overridden: - public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun isEmpty (): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.isEmpty' type=.InlineMutableSet origin=null - FUN name:add visibility:public modality:OPEN <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean - overridden: - public abstract fun add (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:element index:0 type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun add (element: .IT): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun add (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.add' type=.InlineMutableSet origin=null - element: GET_VAR 'element: .IT declared in .InlineMutableSet.add' type=.IT origin=null - FUN name:addAll visibility:public modality:OPEN <> ($this:.InlineMutableSet, elements:kotlin.collections.Collection<.IT>) returnType:kotlin.Boolean - overridden: - public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.IT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun addAll (elements: kotlin.collections.Collection<.IT>): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun addAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.addAll' type=.InlineMutableSet origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.addAll' type=kotlin.collections.Collection<.IT> origin=null - FUN name:clear visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Unit - overridden: - public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - CALL 'public abstract fun clear (): kotlin.Unit declared in kotlin.collections.MutableSet' type=kotlin.Unit origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.clear' type=.InlineMutableSet origin=null - FUN name:iterator visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.collections.MutableIterator<.IT> [operator] - overridden: - public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.MutableIterator<.IT> declared in .InlineMutableSet' - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator declared in kotlin.collections.MutableSet' type=kotlin.collections.MutableIterator<.IT> origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.iterator' type=.InlineMutableSet origin=null - FUN name:remove visibility:public modality:OPEN <> ($this:.InlineMutableSet, element:.IT) returnType:kotlin.Boolean - overridden: - public abstract fun remove (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:element index:0 type:.IT - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun remove (element: .IT): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun remove (element: E of kotlin.collections.MutableSet): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.remove' type=.InlineMutableSet origin=null - element: GET_VAR 'element: .IT declared in .InlineMutableSet.remove' type=.IT origin=null - FUN name:removeAll visibility:public modality:OPEN <> ($this:.InlineMutableSet, elements:kotlin.collections.Collection<.IT>) returnType:kotlin.Boolean - overridden: - public abstract fun removeAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.IT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun removeAll (elements: kotlin.collections.Collection<.IT>): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun removeAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.removeAll' type=.InlineMutableSet origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.removeAll' type=kotlin.collections.Collection<.IT> origin=null - FUN name:retainAll visibility:public modality:OPEN <> ($this:.InlineMutableSet, elements:kotlin.collections.Collection<.IT>) returnType:kotlin.Boolean - overridden: - public abstract fun retainAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection<.IT> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun retainAll (elements: kotlin.collections.Collection<.IT>): kotlin.Boolean declared in .InlineMutableSet' - CALL 'public abstract fun retainAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableSet' type=kotlin.Boolean origin=null - $this: CALL 'private final fun (): kotlin.collections.MutableSet<.IT> declared in .InlineMutableSet' type=kotlin.collections.MutableSet<.IT> origin=GET_PROPERTY - $this: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.retainAll' type=.InlineMutableSet origin=null - elements: GET_VAR 'elements: kotlin.collections.Collection<.IT> declared in .InlineMutableSet.retainAll' type=kotlin.collections.Collection<.IT> origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .InlineMutableSet' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="InlineMutableSet(" - CONST String type=kotlin.String value="ms=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.toString' type=.InlineMutableSet origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.InlineMutableSet) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.InlineMutableSet - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .InlineMutableSet' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.collections.MutableSet' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.hashCode' type=.InlineMutableSet origin=null - FUN GENERATED_SINGLE_FIELD_VALUE_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.InlineMutableSet, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.InlineMutableSet - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - BLOCK_BODY - WHEN type=kotlin.Unit origin=null - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.InlineMutableSet - GET_VAR 'other: kotlin.Any? declared in .InlineMutableSet.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.InlineMutableSet [val] - TYPE_OP type=.InlineMutableSet origin=CAST typeOperand=.InlineMutableSet - GET_VAR 'other: kotlin.Any? declared in .InlineMutableSet.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR ': .InlineMutableSet declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:ms type:kotlin.collections.MutableSet<.IT> visibility:private [final]' type=kotlin.collections.MutableSet<.IT> origin=null - receiver: GET_VAR 'val tmp_1: .InlineMutableSet declared in .InlineMutableSet.equals' type=.InlineMutableSet origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .InlineMutableSet' - CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt deleted file mode 100644 index e82484e320a..00000000000 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.fir.kt.txt +++ /dev/null @@ -1,109 +0,0 @@ -value class IT { - constructor(x: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: Int - field = x - get - - override fun toString(): String { - return "IT(" + "x=" + .#x + ")" - } - - override fun hashCode(): Int { - return .#x.hashCode() - } - - override operator fun equals(other: Any?): Boolean { - when { - other !is IT -> return false - } - val tmp_0: IT = other as IT - when { - EQEQ(arg0 = .#x, arg1 = tmp_0.#x).not() -> return false - } - return true - } - -} - -value class InlineMutableSet : MutableSet { - constructor(ms: MutableSet) /* primary */ { - super/*Any*/() - /* () */ - - } - - private val ms: MutableSet - field = ms - private get - - override val size: Int - override get(): Int { - return .().() - } - - override operator fun contains(element: IT): Boolean { - return .().contains(element = element) - } - - override fun containsAll(elements: Collection): Boolean { - return .().containsAll(elements = elements) - } - - override fun isEmpty(): Boolean { - return .().isEmpty() - } - - override fun add(element: IT): Boolean { - return .().add(element = element) - } - - override fun addAll(elements: Collection): Boolean { - return .().addAll(elements = elements) - } - - override fun clear() { - .().clear() - } - - override operator fun iterator(): MutableIterator { - return .().iterator() - } - - override fun remove(element: IT): Boolean { - return .().remove(element = element) - } - - override fun removeAll(elements: Collection): Boolean { - return .().removeAll(elements = elements) - } - - override fun retainAll(elements: Collection): Boolean { - return .().retainAll(elements = elements) - } - - override fun toString(): String { - return "InlineMutableSet(" + "ms=" + .#ms + ")" - } - - override fun hashCode(): Int { - return .#ms.hashCode() - } - - override operator fun equals(other: Any?): Boolean { - when { - other !is InlineMutableSet -> return false - } - val tmp_1: InlineMutableSet = other as InlineMutableSet - when { - EQEQ(arg0 = .#ms, arg1 = tmp_1.#ms).not() -> return false - } - return true - } - -} - diff --git a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt index cea1ea376af..930b3b1928b 100644 --- a/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt +++ b/compiler/testData/ir/irText/declarations/inlineCollectionOfInlineClass.kt @@ -1,3 +1,7 @@ +// FIR_IDENTICAL +// KT-64271 +// IGNORE_BACKEND_K2: JVM_IR + inline class IT(val x: Int) inline class InlineMutableSet(private val ms: MutableSet) : MutableSet { diff --git a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.sig.kt.txt b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.sig.kt.txt index 85419d3100f..377ed075b46 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.sig.kt.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/k2/expectMemberInNotExpectClass.sig.kt.txt @@ -17,16 +17,19 @@ class C2 : C1 { // Public signature debug description: f(){}kotlin.String // CHECK JS_IR NATIVE: // Mangled name: C2#f(){} - // Mangled name for the signature: f(){} // Public signature: /C2.f|5316533450599009716[0] // Public signature debug description: f(){} /* fake */ override fun f(): String - // CHECK: + // CHECK JVM_IR: // Mangled name: C2{}p // Mangled name for the signature: {}p // Public signature: /C2.p|6715504260787941082[0] // Public signature debug description: {}p + // CHECK JS_IR NATIVE: + // Mangled name: C2{}p + // Public signature: /C2.p|6715504260787941082[0] + // Public signature debug description: {}p /* fake */ override val p: Int // CHECK JVM_IR: // Mangled name: C2#(){}kotlin.Int @@ -35,7 +38,6 @@ class C2 : C1 { // Public signature debug description: (){}kotlin.Int // CHECK JS_IR NATIVE: // Mangled name: C2#(){} - // Mangled name for the signature: (){} // Public signature: /C2.p.|-1162552463316289847[0] // Public signature debug description: (){} /* fake */ override get(): Int diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt deleted file mode 100644 index a0e1d0e4c15..00000000000 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt +++ /dev/null @@ -1,183 +0,0 @@ -FILE fqName: fileName:/SignatureClash.kt - TYPEALIAS name:Some visibility:public expandedType:kotlin.Function1 - CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Factory - CONSTRUCTOR visibility:private <> () returnType:.Factory [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Factory modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:foo visibility:public modality:FINAL <> ($this:.Factory, a:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Factory - VALUE_PARAMETER name:a index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String): kotlin.String declared in .Factory' - CONST String type=kotlin.String value="Alpha" - FUN name:foo visibility:public modality:FINAL <> ($this:.Factory, a:kotlin.String, f:kotlin.Function1) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.Factory - VALUE_PARAMETER name:a index:0 type:kotlin.String - VALUE_PARAMETER name:f index:1 type:kotlin.Function1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (a: kotlin.String, f: kotlin.Function1): kotlin.String declared in .Factory' - CONST String type=kotlin.String value="Omega" - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Base modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Base - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Delegate modality:ABSTRACT visibility:public superTypes:[.Base] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.Delegate) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Delegate - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .Base - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS INTERFACE name:Derived modality:ABSTRACT visibility:public superTypes:[.Delegate] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - FUN FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT <> ($this:.Delegate) returnType:kotlin.Unit [fake_override] - overridden: - public abstract fun bar (): kotlin.Unit declared in .Delegate - $this: VALUE_PARAMETER name: type:.Delegate - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Delegate - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .Delegate - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .Delegate - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:DataClass modality:FINAL visibility:public [data] superTypes:[.Derived; .Delegate] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DataClass - CONSTRUCTOR visibility:public <> (delegate:.Delegate) returnType:.DataClass [primary] - VALUE_PARAMETER name:delegate index:0 type:.Delegate - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DataClass modality:FINAL visibility:public [data] superTypes:[.Derived; .Delegate]' - PROPERTY name:delegate visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final] - EXPRESSION_BODY - GET_VAR 'delegate: .Delegate declared in .DataClass.' type=.Delegate origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.DataClass) returnType:.Delegate - correspondingProperty: PROPERTY name:delegate visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Delegate declared in .DataClass' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.' type=.DataClass origin=null - FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Unit - overridden: - public abstract fun bar (): kotlin.Unit declared in .Derived - public abstract fun bar (): kotlin.Unit declared in .Delegate - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - CALL 'public abstract fun bar (): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.bar' type=.DataClass origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.DataClass) returnType:.Delegate [operator] - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): .Delegate declared in .DataClass' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.component1' type=.DataClass origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.DataClass, delegate:.Delegate) returnType:.DataClass - $this: VALUE_PARAMETER name: type:.DataClass - VALUE_PARAMETER name:delegate index:0 type:.Delegate - EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.copy' type=.DataClass origin=null - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun copy (delegate: .Delegate): .DataClass declared in .DataClass' - CONSTRUCTOR_CALL 'public constructor (delegate: .Delegate) declared in .DataClass' type=.DataClass origin=null - delegate: GET_VAR 'delegate: .Delegate declared in .DataClass.copy' type=.Delegate origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .DataClass' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="DataClass(" - CONST String type=kotlin.String value="delegate=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.toString' type=.DataClass origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .DataClass' - CALL 'public open fun hashCode (): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.hashCode' type=.DataClass origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.DataClass, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.DataClass - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - BLOCK_BODY - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ - arg0: GET_VAR ': .DataClass declared in .DataClass.equals' type=.DataClass origin=null - arg1: GET_VAR 'other: kotlin.Any? declared in .DataClass.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' - CONST Boolean type=kotlin.Boolean value=true - WHEN type=kotlin.Unit origin=null - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.DataClass - GET_VAR 'other: kotlin.Any? declared in .DataClass.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.DataClass [val] - TYPE_OP type=.DataClass origin=CAST typeOperand=.DataClass - GET_VAR 'other: kotlin.Any? declared in .DataClass.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.equals' type=.DataClass origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR 'val tmp_0: .DataClass declared in .DataClass.equals' type=.DataClass origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .DataClass' - CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt deleted file mode 100644 index f938311fd47..00000000000 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt +++ /dev/null @@ -1,76 +0,0 @@ -typealias Some = Function1 -object Factory { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - fun foo(a: String): String { - return "Alpha" - } - - fun foo(a: String, f: Function1): String { - return "Omega" - } - -} - -interface Base { -} - -interface Delegate : Base { - abstract fun bar() - -} - -interface Derived : Delegate { -} - -data class DataClass : Derived, Delegate { - constructor(delegate: Delegate) /* primary */ { - super/*Any*/() - /* () */ - - } - - val delegate: Delegate - field = delegate - get - - override fun bar() { - .#delegate.bar() - } - - operator fun component1(): Delegate { - return .#delegate - } - - fun copy(delegate: Delegate = .#delegate): DataClass { - return DataClass(delegate = delegate) - } - - override fun toString(): String { - return "DataClass(" + "delegate=" + .#delegate + ")" - } - - override fun hashCode(): Int { - return .#delegate.hashCode() - } - - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is DataClass -> return false - } - val tmp_0: DataClass = other as DataClass - when { - EQEQ(arg0 = .#delegate, arg1 = tmp_0.#delegate).not() -> return false - } - return true - } - -} - diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.kt b/compiler/testData/ir/irText/firProblems/SignatureClash.kt index 25c71f0e8ef..b20aad05d00 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.kt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.kt @@ -1,3 +1,7 @@ +// FIR_IDENTICAL +// KT-64271 +// IGNORE_BACKEND_K2: JVM_IR + typealias Some = (Any) -> String? object Factory { diff --git a/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt b/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt index 14e86b1c4cd..bbce31c2cb8 100644 --- a/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt +++ b/compiler/testData/ir/irText/js/external/kt38765.fir.ir.txt @@ -136,16 +136,16 @@ FILE fqName:events fileName:/kt38765.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [external,fake_override] overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [external,fake_override] overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt index 466745202b3..84ec5c879f8 100644 --- a/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt +++ b/compiler/testData/ir/irText/js/native/nativeNativeKotlin.fir.ir.txt @@ -7,16 +7,16 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public [external] superTypes:[kotlin.Any]' FUN name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String $this: VALUE_PARAMETER name: type:foo.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [external,fake_override] overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [external,fake_override] overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any @@ -28,20 +28,20 @@ FILE fqName:foo fileName:/nativeNativeKotlin.kt INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public [external] superTypes:[foo.A]' FUN name:bar visibility:public modality:FINAL <> ($this:foo.B) returnType:kotlin.String $this: VALUE_PARAMETER name: type:foo.B - FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:foo visibility:public modality:FINAL <> ($this:foo.A) returnType:kotlin.String [external,fake_override] overridden: public final fun foo (): kotlin.String declared in foo.A $this: VALUE_PARAMETER name: type:foo.A - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [external,fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in foo.A $this: VALUE_PARAMETER name: type:kotlin.Any VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [external,fake_override] overridden: public open fun hashCode (): kotlin.Int declared in foo.A $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [external,fake_override] overridden: public open fun toString (): kotlin.String declared in foo.A $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java index 855b8b92afc..81c6623b5ed 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java @@ -280,6 +280,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt index 16a0dd0f3a9..5307e28f64c 100644 --- a/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt +++ b/compiler/tests-common-new/tests/org/jetbrains/kotlin/test/frontend/fir/Fir2IrResultsConverter.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.test.frontend.fir +import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.platform.isCommon import org.jetbrains.kotlin.platform.isJs import org.jetbrains.kotlin.platform.jvm.isJvm @@ -17,7 +18,7 @@ import org.jetbrains.kotlin.test.model.TestModule import org.jetbrains.kotlin.test.services.TestServices fun TestModule.shouldUseIrFakeOverrideBuilder(): Boolean { - return CodegenTestDirectives.ENABLE_IR_FAKE_OVERRIDE_GENERATION in directives + return !targetPlatform.isJvm() || CodegenTestDirectives.ENABLE_IR_FAKE_OVERRIDE_GENERATION in directives } class Fir2IrResultsConverter( diff --git a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java index fde806cd5dc..a53103c709a 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java @@ -207,6 +207,11 @@ public class KlibIrTextTestCaseGenerated extends AbstractKlibIrTextTestCase { runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { runTest("compiler/testData/ir/irText/classes/primaryConstructor.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java index d7b54ff102d..b3e0c843c5f 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java @@ -232,6 +232,12 @@ public class FirLightTreeJsIrTextTestGenerated extends AbstractFirLightTreeJsIrT runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java index e0e96938eff..0d869e9023e 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java @@ -232,6 +232,12 @@ public class FirPsiJsIrTextTestGenerated extends AbstractFirPsiJsIrTextTest { runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java index 68b5d57384f..1c9bf8e74bb 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java @@ -232,6 +232,12 @@ public class ClassicJsIrTextTestGenerated extends AbstractClassicJsIrTextTest { runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Fir2Ir.kt b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Fir2Ir.kt index 5d38fbd5707..7079e18c80a 100644 --- a/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Fir2Ir.kt +++ b/kotlin-native/backend.native/compiler/ir/backend.native/src/org/jetbrains/kotlin/backend/konan/Fir2Ir.kt @@ -106,7 +106,7 @@ internal fun PhaseContext.fir2Ir( inlineConstTracker = null, expectActualTracker = configuration[CommonConfigurationKeys.EXPECT_ACTUAL_TRACKER], allowNonCachedDeclarations = false, - useIrFakeOverrideBuilder = configuration.getBoolean(CommonConfigurationKeys.USE_IR_FAKE_OVERRIDE_BUILDER), + useIrFakeOverrideBuilder = true, ) val (irModuleFragment, components, pluginContext, irActualizedResult) = input.firResult.convertToIrAndActualize( NativeFir2IrExtensions, diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java index 1efba3c0d24..462032ac42b 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/ClassicNativeIrTextTestGenerated.java @@ -232,6 +232,12 @@ public class ClassicNativeIrTextTestGenerated extends AbstractClassicNativeIrTex runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java index 149a1b715f4..288ea27961f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirLightTreeNativeIrTextTestGenerated.java @@ -232,6 +232,12 @@ public class FirLightTreeNativeIrTextTestGenerated extends AbstractFirLightTreeN runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java index baa208a7956..44aec18db3a 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/irtext/FirPsiNativeIrTextTestGenerated.java @@ -232,6 +232,12 @@ public class FirPsiNativeIrTextTestGenerated extends AbstractFirPsiNativeIrTextT runTest("compiler/testData/ir/irText/classes/outerClassAccess.kt"); } + @Test + @TestMetadata("overriddenEquals.kt") + public void testOverriddenEquals() throws Exception { + runTest("compiler/testData/ir/irText/classes/overriddenEquals.kt"); + } + @Test @TestMetadata("primaryConstructor.kt") public void testPrimaryConstructor() throws Exception {