From a084c5bf7da47e06b1999a745a3c0c201e084364 Mon Sep 17 00:00:00 2001 From: Jinseong Jeon Date: Wed, 29 Apr 2020 08:21:43 -0700 Subject: [PATCH] FIR2IR: populate overriddenSymbols for overriding properties --- .../kotlin/fir/backend/ConversionUtils.kt | 71 +++++++++++++++---- .../fir/backend/Fir2IrDeclarationStorage.kt | 41 +++++++++-- .../testData/codegen/box/bridges/kt2833.kt | 1 - .../codegen/box/bridges/propertyDiamond.kt | 1 - .../box/bridges/propertyInConstructor.kt | 1 - .../codegen/box/bridges/propertySetter.kt | 1 - .../substitutionInSuperClass/property.kt | 1 - .../testData/codegen/box/coroutines/await.kt | 1 - .../box/coroutines/controlFlow/doubleBreak.kt | 1 - .../coroutines/controlFlow/labeledWhile.kt | 1 - .../controlFlow/returnFromFinally.kt | 1 - .../controlFlow/returnWithFinally.kt | 1 - .../controlFlow/throwFromFinally.kt | 1 - .../interfaceMethodWithBodyGeneric.kt | 1 - .../coroutines/handleResultCallEmptyBody.kt | 1 - .../box/coroutines/handleResultSuspended.kt | 1 - .../indirectInlineUsedAsNonInline.kt | 1 - .../box/coroutines/inlinedTryCatchFinally.kt | 1 - .../codegen/box/coroutines/kt12958.kt | 1 - .../box/coroutines/lastExpressionIsLoop.kt | 1 - .../box/coroutines/lastStementAssignment.kt | 1 - .../box/coroutines/lastUnitExpression.kt | 1 - .../multiModule/inlineMultiModule.kt | 1 - .../multiModule/inlineMultiModuleOverride.kt | 1 - .../inlineMultiModuleWithController.kt | 1 - .../inlineMultiModuleWithInnerInlining.kt | 1 - .../box/coroutines/noSuspensionPoints.kt | 1 - .../box/coroutines/recursiveSuspend.kt | 1 - .../codegen/box/coroutines/returnByLabel.kt | 1 - .../coroutines/statementLikeLastExpression.kt | 1 - .../suspendCoroutineFromStateMachine.kt | 1 - .../box/coroutines/suspendImplBridge.kt | 1 - .../tailCallOptimizations/tryCatch.kt | 1 - .../coroutines/tryFinallyWithHandleResult.kt | 1 - .../coroutines/unitTypeReturn/unitSafeCall.kt | 1 - .../codegen/box/mangling/internalOverride.kt | 1 - .../box/mangling/internalOverrideSuperCall.kt | 1 + .../codegen/box/mangling/publicOverride.kt | 1 - .../box/mangling/publicOverrideSuperCall.kt | 1 + .../forInCharSequenceWithCustomIterator.kt | 1 - ...rInCharSequenceWithMultipleGetFunctions.kt | 1 - .../classes/delegatedImplementation.fir.txt | 6 ++ .../irText/declarations/fakeOverrides.fir.txt | 2 + .../localClassWithOverrides.fir.txt | 6 ++ .../expressions/enumEntryAsReceiver.fir.txt | 2 + .../genericClassInDifferentModule_m2.fir.txt | 4 ++ 46 files changed, 112 insertions(+), 59 deletions(-) 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 745fd9c7f37..27c47e7ac6b 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 @@ -304,18 +304,50 @@ private fun IrClass.findMatchingOverriddenSymbolsFromThisAndSupertypes( target: IrDeclaration, result: MutableList ): List { + val targetIsPropertyAccessor = target is IrFunction && target.isPropertyAccessor for (declaration in declarations) { + if (declaration.isFakeOverride || declaration is IrConstructor) { + continue + } when { declaration is IrFunction && target is IrFunction -> - if (declaration !is IrConstructor && - !declaration.isFakeOverride && - declaration.descriptor.modality != Modality.FINAL && + if (declaration.descriptor.modality != Modality.FINAL && !Visibilities.isPrivate(declaration.visibility) && isOverriding(irBuiltIns, target, declaration) ) { result.add(declaration.symbol) } - // TODO: property lookup to set overriddenSymbols for IrProperty (and accessors)? + declaration is IrProperty && (target is IrField || targetIsPropertyAccessor) -> { + val backingField = declaration.backingField + if (target is IrField && backingField != null) { + if (!backingField.isFinal && !backingField.isStatic && + !Visibilities.isPrivate(backingField.visibility) && + isOverriding(irBuiltIns, target, backingField) + ) { + result.add(backingField.symbol) + } + } + if (targetIsPropertyAccessor) { + val getter = declaration.getter + if (getter != null) { + if (getter.descriptor.modality != Modality.FINAL && + !Visibilities.isPrivate(getter.visibility) && + isOverriding(irBuiltIns, target, getter) + ) { + result.add(getter.symbol) + } + } + val setter = declaration.setter + if (setter != null) { + if (setter.descriptor.modality != Modality.FINAL && + !Visibilities.isPrivate(setter.visibility) && + isOverriding(irBuiltIns, target, setter) + ) { + result.add(setter.symbol) + } + } + } + } } } // Stop traversing upwards if we find matching overridden symbols at this level. @@ -327,8 +359,8 @@ private fun IrClass.findMatchingOverriddenSymbolsFromThisAndSupertypes( fun isOverriding( irBuiltIns: IrBuiltIns, - target: IrFunction, - superCandidate: IrFunction + target: IrDeclaration, + superCandidate: IrDeclaration ): Boolean { val typeCheckerContext = IrTypeCheckerContext(irBuiltIns) as AbstractTypeCheckerContext fun equalTypes(first: IrType, second: IrType): Boolean { @@ -340,16 +372,25 @@ fun isOverriding( } - return target.name == superCandidate.name && + return when { + target is IrFunction && superCandidate is IrFunction -> { // Not checking the return type (they should match each other if everything other match, otherwise it's a compilation error) - target.extensionReceiverParameter?.type?.let { - val superCandidateReceiverType = superCandidate.extensionReceiverParameter?.type - superCandidateReceiverType != null && equalTypes(it, superCandidateReceiverType) - } != false && - target.valueParameters.size == superCandidate.valueParameters.size && - target.valueParameters.zip(superCandidate.valueParameters).all { (targetParameter, superCandidateParameter) -> - equalTypes(targetParameter.type, superCandidateParameter.type) - } + target.name == superCandidate.name && + target.extensionReceiverParameter?.type?.let { + val superCandidateReceiverType = superCandidate.extensionReceiverParameter?.type + superCandidateReceiverType != null && equalTypes(it, superCandidateReceiverType) + } != false && + target.valueParameters.size == superCandidate.valueParameters.size && + target.valueParameters.zip(superCandidate.valueParameters).all { (targetParameter, superCandidateParameter) -> + equalTypes(targetParameter.type, superCandidateParameter.type) + } + } + target is IrField && superCandidate is IrField -> { + // Not checking the field type (they should match each other if everything other match, otherwise it's a compilation error) + target.name == superCandidate.name + } + else -> false + } } private val nameToOperationConventionOrigin = mutableMapOf( diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index bec54f989ae..c20b6961830 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -10,8 +10,10 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns.* import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyAccessor import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertySetter +import org.jetbrains.kotlin.fir.declarations.impl.FirPropertyAccessorImpl import org.jetbrains.kotlin.fir.descriptors.FirBuiltInsPackageFragment import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor import org.jetbrains.kotlin.fir.descriptors.FirPackageFragmentDescriptor @@ -454,11 +456,7 @@ class Fir2IrDeclarationStorage( } } if (!created.isFakeOverride && simpleFunction?.isOverride == true && thisReceiverOwner != null) { - thisReceiverOwner.findMatchingOverriddenSymbolsFromSupertypes(components.irBuiltIns, created).forEach { - if (it is IrSimpleFunctionSymbol) { - created.overriddenSymbols += it - } - } + created.populateOverriddenSymbols(thisReceiverOwner) } functionCache[function] = created return created @@ -575,6 +573,14 @@ class Fir2IrDeclarationStorage( parent = irParent } correspondingPropertySymbol = correspondingProperty.symbol + val isOverride = when (propertyAccessor) { + is FirDefaultPropertyAccessor -> property.isOverride + is FirPropertyAccessorImpl -> propertyAccessor.status.isOverride + else -> false + } + if (!isFakeOverride && isOverride && thisReceiverOwner != null) { + populateOverriddenSymbols(thisReceiverOwner) + } } } } @@ -587,6 +593,7 @@ class Fir2IrDeclarationStorage( name: Name, isFinal: Boolean, firInitializerExpression: FirExpression?, + thisReceiverOwner: IrClass?, type: IrType? = null ): IrField { val inferredType = type ?: firInitializerExpression!!.typeRef.toIrType() @@ -601,6 +608,9 @@ class Fir2IrDeclarationStorage( isFakeOverride = origin == IrDeclarationOrigin.FAKE_OVERRIDE ).also { it.correspondingPropertySymbol = this@createBackingField.symbol + if (!isFakeOverride && property.isOverride && thisReceiverOwner != null) { + it.populateOverriddenSymbols(thisReceiverOwner) + } } } } @@ -656,7 +666,8 @@ class Fir2IrDeclarationStorage( ) { backingField = createBackingField( property, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, descriptor, - property.fieldVisibility, property.name, property.isVal, initializer, type + property.fieldVisibility, property.name, property.isVal, initializer, + thisReceiverOwner, type ).also { field -> if (initializer is FirConstExpression<*>) { // TODO: Normally we shouldn't have error type here @@ -667,7 +678,8 @@ class Fir2IrDeclarationStorage( } else if (delegate != null) { backingField = createBackingField( property, IrDeclarationOrigin.PROPERTY_DELEGATE, descriptor, - property.fieldVisibility, Name.identifier("${property.name}\$delegate"), true, delegate + property.fieldVisibility, Name.identifier("${property.name}\$delegate"), true, delegate, + thisReceiverOwner ) } if (irParent != null) { @@ -926,6 +938,21 @@ class Fir2IrDeclarationStorage( } } + private fun IrSimpleFunction.populateOverriddenSymbols(thisReceiverOwner: IrClass) { + thisReceiverOwner.findMatchingOverriddenSymbolsFromSupertypes(components.irBuiltIns, this).forEach { + if (it is IrSimpleFunctionSymbol) { + overriddenSymbols += it + } + } + } + + private fun IrField.populateOverriddenSymbols(thisReceiverOwner: IrClass) { + thisReceiverOwner.findMatchingOverriddenSymbolsFromSupertypes(components.irBuiltIns, this) + .filterIsInstance().singleOrNull()?.let { + overriddenSymbols = listOf(it) + } + } + companion object { internal val ENUM_SYNTHETIC_NAMES = mapOf( Name.identifier("values") to IrSyntheticBodyKind.ENUM_VALUES, diff --git a/compiler/testData/codegen/box/bridges/kt2833.kt b/compiler/testData/codegen/box/bridges/kt2833.kt index be59bcf0f3b..50a2989d904 100644 --- a/compiler/testData/codegen/box/bridges/kt2833.kt +++ b/compiler/testData/codegen/box/bridges/kt2833.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR package test public interface FunDependencyEdge { diff --git a/compiler/testData/codegen/box/bridges/propertyDiamond.kt b/compiler/testData/codegen/box/bridges/propertyDiamond.kt index a062d3b0067..802f6f77932 100644 --- a/compiler/testData/codegen/box/bridges/propertyDiamond.kt +++ b/compiler/testData/codegen/box/bridges/propertyDiamond.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { val o: O val k: K diff --git a/compiler/testData/codegen/box/bridges/propertyInConstructor.kt b/compiler/testData/codegen/box/bridges/propertyInConstructor.kt index 028880c1fba..9ca1e8bf8f5 100644 --- a/compiler/testData/codegen/box/bridges/propertyInConstructor.kt +++ b/compiler/testData/codegen/box/bridges/propertyInConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { var x: T } diff --git a/compiler/testData/codegen/box/bridges/propertySetter.kt b/compiler/testData/codegen/box/bridges/propertySetter.kt index 1b6981adebe..a258dc85346 100644 --- a/compiler/testData/codegen/box/bridges/propertySetter.kt +++ b/compiler/testData/codegen/box/bridges/propertySetter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { var v: T } diff --git a/compiler/testData/codegen/box/bridges/substitutionInSuperClass/property.kt b/compiler/testData/codegen/box/bridges/substitutionInSuperClass/property.kt index c461224a84c..21208405891 100644 --- a/compiler/testData/codegen/box/bridges/substitutionInSuperClass/property.kt +++ b/compiler/testData/codegen/box/bridges/substitutionInSuperClass/property.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class A(val t: T) { open val foo: T = t } diff --git a/compiler/testData/codegen/box/coroutines/await.kt b/compiler/testData/codegen/box/coroutines/await.kt index de38a4c1ce5..a47acf9136e 100644 --- a/compiler/testData/codegen/box/coroutines/await.kt +++ b/compiler/testData/codegen/box/coroutines/await.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/doubleBreak.kt b/compiler/testData/codegen/box/coroutines/controlFlow/doubleBreak.kt index 54f83f9b75d..a6606899ddb 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/doubleBreak.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/doubleBreak.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt b/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt index c853c0ed718..205634c1a0c 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/labeledWhile.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt b/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt index c2bf4ed7f61..8ea2cedaf8f 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/returnFromFinally.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/returnWithFinally.kt b/compiler/testData/codegen/box/coroutines/controlFlow/returnWithFinally.kt index f20e200a970..440f86654b4 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/returnWithFinally.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/returnWithFinally.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/controlFlow/throwFromFinally.kt b/compiler/testData/codegen/box/coroutines/controlFlow/throwFromFinally.kt index be178abb472..5ab5f60cd78 100644 --- a/compiler/testData/codegen/box/coroutines/controlFlow/throwFromFinally.kt +++ b/compiler/testData/codegen/box/coroutines/controlFlow/throwFromFinally.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt b/compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt index 31f3fc487b3..c62d166b6d7 100644 --- a/compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt +++ b/compiler/testData/codegen/box/coroutines/featureIntersection/interfaceMethodWithBodyGeneric.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt b/compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt index 4649967e381..c30b0d23890 100644 --- a/compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt +++ b/compiler/testData/codegen/box/coroutines/handleResultCallEmptyBody.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt b/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt index d87afc7975f..211bfe46211 100644 --- a/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt +++ b/compiler/testData/codegen/box/coroutines/handleResultSuspended.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt b/compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt index dbf5d981890..53113bc548a 100644 --- a/compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt +++ b/compiler/testData/codegen/box/coroutines/indirectInlineUsedAsNonInline.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt b/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt index 6a38067f01f..d66f21d0203 100644 --- a/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt +++ b/compiler/testData/codegen/box/coroutines/inlinedTryCatchFinally.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/coroutines/kt12958.kt b/compiler/testData/codegen/box/coroutines/kt12958.kt index 90fccea0863..5de10da7c30 100644 --- a/compiler/testData/codegen/box/coroutines/kt12958.kt +++ b/compiler/testData/codegen/box/coroutines/kt12958.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt b/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt index 2569b33ccc8..101a1257da5 100644 --- a/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt +++ b/compiler/testData/codegen/box/coroutines/lastExpressionIsLoop.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt b/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt index 640b506b4b7..e8402f6a1b9 100644 --- a/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt +++ b/compiler/testData/codegen/box/coroutines/lastStementAssignment.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt b/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt index 671fe7b92ed..d4d946acf64 100644 --- a/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt +++ b/compiler/testData/codegen/box/coroutines/lastUnitExpression.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt index 875973e2b5d..72cee2ee5e4 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModule.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_COROUTINES // WITH_RUNTIME // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt index 869a3263437..96bd6e26f5e 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleOverride.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_COROUTINES // WITH_RUNTIME // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt index 83b1bef02a7..02f12ed6240 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithController.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_COROUTINES // WITH_RUNTIME // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt index 83edc3f4317..3aca04ab5a1 100644 --- a/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt +++ b/compiler/testData/codegen/box/coroutines/multiModule/inlineMultiModuleWithInnerInlining.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE // WITH_COROUTINES // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt b/compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt index d783fe6c11b..c8eddab8a3b 100644 --- a/compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt +++ b/compiler/testData/codegen/box/coroutines/noSuspensionPoints.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt b/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt index 811da107a1e..90f5e4c633f 100644 --- a/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt +++ b/compiler/testData/codegen/box/coroutines/recursiveSuspend.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/returnByLabel.kt b/compiler/testData/codegen/box/coroutines/returnByLabel.kt index 93d9c970101..836f10ae700 100644 --- a/compiler/testData/codegen/box/coroutines/returnByLabel.kt +++ b/compiler/testData/codegen/box/coroutines/returnByLabel.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt b/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt index 659f42992a3..2e356a6257c 100644 --- a/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt +++ b/compiler/testData/codegen/box/coroutines/statementLikeLastExpression.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt b/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt index 74a96913940..4e2fd0f4157 100644 --- a/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt +++ b/compiler/testData/codegen/box/coroutines/suspendCoroutineFromStateMachine.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/coroutines/suspendImplBridge.kt b/compiler/testData/codegen/box/coroutines/suspendImplBridge.kt index 89b9f19737a..a66240fbc86 100644 --- a/compiler/testData/codegen/box/coroutines/suspendImplBridge.kt +++ b/compiler/testData/codegen/box/coroutines/suspendImplBridge.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt index 745df87e848..6b9518e2e61 100644 --- a/compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt +++ b/compiler/testData/codegen/box/coroutines/tailCallOptimizations/tryCatch.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt b/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt index 81b96a48d90..11c44fc116f 100644 --- a/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt +++ b/compiler/testData/codegen/box/coroutines/tryFinallyWithHandleResult.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME // WITH_COROUTINES diff --git a/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt b/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt index 703bbe261ea..04d923b6ca9 100644 --- a/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt +++ b/compiler/testData/codegen/box/coroutines/unitTypeReturn/unitSafeCall.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // WITH_COROUTINES // COMMON_COROUTINES_TEST diff --git a/compiler/testData/codegen/box/mangling/internalOverride.kt b/compiler/testData/codegen/box/mangling/internalOverride.kt index c0acd3a918a..b8ac1e207a1 100644 --- a/compiler/testData/codegen/box/mangling/internalOverride.kt +++ b/compiler/testData/codegen/box/mangling/internalOverride.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class A { internal open val field = "AF" diff --git a/compiler/testData/codegen/box/mangling/internalOverrideSuperCall.kt b/compiler/testData/codegen/box/mangling/internalOverrideSuperCall.kt index 64424c1dd80..e5530d5d9e3 100644 --- a/compiler/testData/codegen/box/mangling/internalOverrideSuperCall.kt +++ b/compiler/testData/codegen/box/mangling/internalOverrideSuperCall.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND_FIR: JVM_IR open class A { internal open val field = "F" diff --git a/compiler/testData/codegen/box/mangling/publicOverride.kt b/compiler/testData/codegen/box/mangling/publicOverride.kt index d9a6389473d..0087a1fbc66 100644 --- a/compiler/testData/codegen/box/mangling/publicOverride.kt +++ b/compiler/testData/codegen/box/mangling/publicOverride.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class A { internal open val field = "AF" diff --git a/compiler/testData/codegen/box/mangling/publicOverrideSuperCall.kt b/compiler/testData/codegen/box/mangling/publicOverrideSuperCall.kt index 422f510101e..40bcb6b6077 100644 --- a/compiler/testData/codegen/box/mangling/publicOverrideSuperCall.kt +++ b/compiler/testData/codegen/box/mangling/publicOverrideSuperCall.kt @@ -1,3 +1,4 @@ +// IGNORE_BACKEND_FIR: JVM_IR open class A { internal open val field = "F" diff --git a/compiler/testData/codegen/box/ranges/forInCharSequenceWithCustomIterator.kt b/compiler/testData/codegen/box/ranges/forInCharSequenceWithCustomIterator.kt index 4469b12fc51..cbe68b5f5ee 100644 --- a/compiler/testData/codegen/box/ranges/forInCharSequenceWithCustomIterator.kt +++ b/compiler/testData/codegen/box/ranges/forInCharSequenceWithCustomIterator.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/codegen/box/ranges/forInCharSequenceWithMultipleGetFunctions.kt b/compiler/testData/codegen/box/ranges/forInCharSequenceWithMultipleGetFunctions.kt index 36fa88646bc..968e2762f14 100644 --- a/compiler/testData/codegen/box/ranges/forInCharSequenceWithMultipleGetFunctions.kt +++ b/compiler/testData/codegen/box/ranges/forInCharSequenceWithMultipleGetFunctions.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME import kotlin.test.* diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt index b64b58d68f2..125f087574a 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt @@ -122,6 +122,8 @@ FILE fqName: fileName:/delegatedImplementation.kt GET_VAR 'x0: kotlin.String declared in .otherImpl' type=kotlin.String origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.String correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.String declared in .IOther $this: VALUE_PARAMETER name: type:.otherImpl. BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .otherImpl.' @@ -133,6 +135,8 @@ FILE fqName: fileName:/delegatedImplementation.kt GET_VAR 'y0: kotlin.Int declared in .otherImpl' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.Int correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + overridden: + public abstract fun (): kotlin.Int declared in .IOther $this: VALUE_PARAMETER name: type:.otherImpl. BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .otherImpl.' @@ -140,6 +144,8 @@ FILE fqName: fileName:/delegatedImplementation.kt receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.otherImpl., :kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + overridden: + public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther $this: VALUE_PARAMETER name: type:.otherImpl. VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt b/compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt index 6650f6249b7..610fc3efb39 100644 --- a/compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt +++ b/compiler/testData/ir/irText/declarations/fakeOverrides.fir.txt @@ -73,6 +73,8 @@ FILE fqName: fileName:/fakeOverrides.kt CONST Int type=kotlin.Int value=42 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.Int declared in .IBar $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Test1' diff --git a/compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt b/compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt index 1731d4e9e24..0f36a69e29b 100644 --- a/compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt +++ b/compiler/testData/ir/irText/declarations/localClassWithOverrides.fir.txt @@ -51,6 +51,8 @@ FILE fqName: fileName:/localClassWithOverrides.kt CONST Int type=kotlin.Int value=1 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.outer.Local) returnType:kotlin.Int correspondingProperty: PROPERTY name:aval visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.Int declared in .outer.ALocal $this: VALUE_PARAMETER name: type:.outer.Local BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .outer.Local' @@ -62,6 +64,8 @@ FILE fqName: fileName:/localClassWithOverrides.kt CONST Int type=kotlin.Int value=2 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.outer.Local) returnType:kotlin.Int correspondingProperty: PROPERTY name:avar visibility:public modality:FINAL [var] + overridden: + public abstract fun (): kotlin.Int declared in .outer.ALocal $this: VALUE_PARAMETER name: type:.outer.Local BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .outer.Local' @@ -69,6 +73,8 @@ FILE fqName: fileName:/localClassWithOverrides.kt receiver: GET_VAR ': .outer.Local declared in .outer.Local.' type=.outer.Local origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.outer.Local, :kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:avar visibility:public modality:FINAL [var] + overridden: + public abstract fun (: kotlin.Int): kotlin.Unit declared in .outer.ALocal $this: VALUE_PARAMETER name: type:.outer.Local VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index 303d1a4c7ea..a453560cc03 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -37,6 +37,8 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt $this: GET_VAR ': .X.B declared in .X.B' type=.X.B origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.X.B) returnType:kotlin.Function0 correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] + overridden: + public abstract fun (): kotlin.Function0 declared in .X $this: VALUE_PARAMETER name: type:.X.B BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0 declared in .X.B' diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt index 99110fd5425..71a213278fe 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt @@ -25,6 +25,8 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt GET_VAR 'x: T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Derived1.Derived1>) returnType:T of .Derived1 correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + overridden: + public abstract fun (): T of .Base declared in .Base $this: VALUE_PARAMETER name: type:.Derived1.Derived1> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of .Derived1 declared in .Derived1' @@ -32,6 +34,8 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt receiver: GET_VAR ': .Derived1.Derived1> declared in .Derived1.' type=.Derived1.Derived1> origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Derived1.Derived1>, :T of .Derived1) returnType:kotlin.Unit correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + overridden: + public abstract fun (: T of .Base): kotlin.Unit declared in .Base $this: VALUE_PARAMETER name: type:.Derived1.Derived1> VALUE_PARAMETER name: index:0 type:T of .Derived1 BLOCK_BODY