diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index 63c96d5458b..4c884992018 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -36,6 +36,7 @@ import org.jetbrains.kotlin.ir.expressions.IrConstKind import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin import org.jetbrains.kotlin.ir.expressions.impl.IrConstImpl import org.jetbrains.kotlin.ir.symbols.* +import org.jetbrains.kotlin.ir.symbols.impl.IrClassPublicSymbolImpl import org.jetbrains.kotlin.ir.symbols.impl.IrClassSymbolImpl import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.impl.IrErrorTypeImpl @@ -296,7 +297,7 @@ internal fun IrClass.findMatchingOverriddenSymbolsFromSupertypes( ): List { for (superType in superTypes) { val superTypeClass = superType.classOrNull - if (superTypeClass is IrClassSymbolImpl) { + if (superTypeClass is IrClassSymbolImpl || superTypeClass is IrClassPublicSymbolImpl) { superTypeClass.owner.findMatchingOverriddenSymbolsFromThisAndSupertypes(irBuiltIns, target, result, visited) } } diff --git a/compiler/testData/codegen/box/bridges/strListContains.kt b/compiler/testData/codegen/box/bridges/strListContains.kt index f123e448b29..0d260822554 100644 --- a/compiler/testData/codegen/box/bridges/strListContains.kt +++ b/compiler/testData/codegen/box/bridges/strListContains.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR - class StrList : List { override val size: Int get() = throw UnsupportedOperationException() diff --git a/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt index d3b79754794..ba84efefebb 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/asWithMutable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt index 4d04d780c68..f3f382bde0c 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/isWithMutable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt index d0fd7ff4202..44ec882a87b 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/reifiedAsWithMutable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt index cca2b1e2112..812b77298a0 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/reifiedIsWithMutable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt index a28089d3f5a..25120f2f2a7 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/reifiedSafeAsWithMutable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt b/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt index 3921127de4a..327fa12b5b7 100644 --- a/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt +++ b/compiler/testData/codegen/box/casts/mutableCollections/safeAsWithMutable.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/collections/platformValueContains.kt b/compiler/testData/codegen/box/collections/platformValueContains.kt index ed6f78f6425..14d2cece53c 100644 --- a/compiler/testData/codegen/box/collections/platformValueContains.kt +++ b/compiler/testData/codegen/box/collections/platformValueContains.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: J.java diff --git a/compiler/testData/codegen/box/controlStructures/emptyFor.kt b/compiler/testData/codegen/box/controlStructures/emptyFor.kt index d2616276b8e..6a09c1b3b43 100644 --- a/compiler/testData/codegen/box/controlStructures/emptyFor.kt +++ b/compiler/testData/codegen/box/controlStructures/emptyFor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR var index = 0 interface IterableIterator : Iterator { diff --git a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexCheckSideEffects.kt b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexCheckSideEffects.kt index 0a8e89a493c..69d1de655a9 100644 --- a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexCheckSideEffects.kt +++ b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexCheckSideEffects.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoElementVarCheckSideEffects.kt b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoElementVarCheckSideEffects.kt index e3d6676adec..6ac0a7198a7 100644 --- a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoElementVarCheckSideEffects.kt +++ b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoElementVarCheckSideEffects.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoIndexVarCheckSideEffects.kt b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoIndexVarCheckSideEffects.kt index 96ac0bfe7a7..cd53b7681d9 100644 --- a/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoIndexVarCheckSideEffects.kt +++ b/compiler/testData/codegen/box/controlStructures/forInIterableWithIndex/forInIterableWithIndexNoIndexVarCheckSideEffects.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/controlStructures/forUserType.kt b/compiler/testData/codegen/box/controlStructures/forUserType.kt index d597444da21..66fa1536564 100644 --- a/compiler/testData/codegen/box/controlStructures/forUserType.kt +++ b/compiler/testData/codegen/box/controlStructures/forUserType.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 // TODO: muted automatically, investigate should it be ran for JS or not diff --git a/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt b/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt index 2a394b499e5..16d40a585fb 100644 --- a/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt +++ b/compiler/testData/codegen/box/inlineClasses/createInlineClassInArgumentPosition.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR inline class AsInt(val value: Int) { override fun toString(): String { diff --git a/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt index 732daa20476..336642d15ca 100644 --- a/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt +++ b/compiler/testData/codegen/box/inlineClasses/inlineClassValuesInsideStrings.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR inline class Augmented(val x: Int) { override fun toString(): String = (x + 1).toString() diff --git a/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt b/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt index 4d2f54c5ceb..d596194b4b4 100644 --- a/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt +++ b/compiler/testData/codegen/box/inlineClasses/toStringCallingPrivateFun.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +InlineClasses -// IGNORE_BACKEND_FIR: JVM_IR inline class IC(val x: String) { private fun privateFun() = x diff --git a/compiler/testData/codegen/box/objects/useAnonymousObjectAsIterator.kt b/compiler/testData/codegen/box/objects/useAnonymousObjectAsIterator.kt index 5c50c8727b3..4b492007eb1 100644 --- a/compiler/testData/codegen/box/objects/useAnonymousObjectAsIterator.kt +++ b/compiler/testData/codegen/box/objects/useAnonymousObjectAsIterator.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KT-5869 operator fun Iterator.iterator(): Iterator = this diff --git a/compiler/testData/codegen/box/specialBuiltins/emptyList.kt b/compiler/testData/codegen/box/specialBuiltins/emptyList.kt index b515a6a957c..7c7eb4def7a 100644 --- a/compiler/testData/codegen/box/specialBuiltins/emptyList.kt +++ b/compiler/testData/codegen/box/specialBuiltins/emptyList.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS private object EmptyList : List { diff --git a/compiler/testData/codegen/box/specialBuiltins/emptyMap.kt b/compiler/testData/codegen/box/specialBuiltins/emptyMap.kt index 64e70ea9d31..c0770bd6b2a 100644 --- a/compiler/testData/codegen/box/specialBuiltins/emptyMap.kt +++ b/compiler/testData/codegen/box/specialBuiltins/emptyMap.kt @@ -1,5 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR - private object EmptyMap : Map { override val size: Int get() = 0 override fun isEmpty(): Boolean = true diff --git a/compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt b/compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt index 17086a66daf..fd4953af8ec 100644 --- a/compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt +++ b/compiler/testData/codegen/box/specialBuiltins/emptyStringMap.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR private object EmptyStringMap : Map { override val size: Int get() = 0 override fun isEmpty(): Boolean = true diff --git a/compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt b/compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt index 0b7a4cb4dc2..53f24fef139 100644 --- a/compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt +++ b/compiler/testData/ir/irText/classes/dataClassesGeneric.fir.txt @@ -266,7 +266,7 @@ FILE fqName: fileName:/dataClassesGeneric.kt $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test3.Test3> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test3' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.List' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List.Test3> visibility:private [final]' type=kotlin.collections.List.Test3> origin=null receiver: GET_VAR ': .Test3.Test3> declared in .Test3.hashCode' type=.Test3.Test3> origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test3.Test3>) returnType:kotlin.String @@ -355,7 +355,7 @@ FILE fqName: fileName:/dataClassesGeneric.kt $this: VALUE_PARAMETER GENERATED_DATA_CLASS_MEMBER name: type:.Test4 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test4' - CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + CALL 'public open fun hashCode (): kotlin.Int [fake_override] declared in kotlin.collections.List' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.collections.List visibility:private [final]' type=kotlin.collections.List origin=null receiver: GET_VAR ': .Test4 declared in .Test4.hashCode' type=.Test4 origin=null FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test4) returnType:kotlin.String diff --git a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.txt b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.txt index 88ae92012f3..35b49f52d51 100644 --- a/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.txt +++ b/compiler/testData/ir/irText/classes/inlineClassSyntheticMethods.fir.txt @@ -19,6 +19,8 @@ FILE fqName: fileName:/inlineClassSyntheticMethods.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:T of .C visibility:private [final]' type=T of .C origin=null receiver: GET_VAR ': .C.C> declared in .C.' type=.C.C> origin=null FUN name:hashCode visibility:public modality:FINAL <> ($this:.C.C>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.C.C> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun hashCode (): kotlin.Int declared in .C' diff --git a/compiler/testData/ir/irText/classes/superCalls.fir.txt b/compiler/testData/ir/irText/classes/superCalls.fir.txt index 0e2925da2d6..290e4398d0e 100644 --- a/compiler/testData/ir/irText/classes/superCalls.fir.txt +++ b/compiler/testData/ir/irText/classes/superCalls.fir.txt @@ -20,6 +20,8 @@ FILE fqName: fileName:/superCalls.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null receiver: GET_VAR ': .Base declared in .Base.' type=.Base origin=null FUN name:hashCode visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any $this: VALUE_PARAMETER name: type:.Base BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Base'