From 7813bb35cf50f2ebc43f6a0d231d6a34a582b569 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 6 Dec 2023 13:11:44 +0200 Subject: [PATCH] [FIR2IR] Provide remapped f/o symbols to declaration storage After a generation of fake overrides some code may still to refer old symbols from declaration storage (like computation of overridden symbols for lazy functions), so we need to remap those symbols using information from IR f/o generator --- ...LFirBlackBoxCodegenBasedTestGenerated.java | 6 + ...rsedBlackBoxCodegenBasedTestGenerated.java | 6 + .../kotlin/fir/pipeline/convertToIr.kt | 2 + .../kotlin/fir/backend/Fir2IrComponents.kt | 1 + .../fir/backend/Fir2IrComponentsStorage.kt | 1 + .../fir/backend/Fir2IrDeclarationStorage.kt | 11 +- .../Fir2IrSymbolsMappingForLazyClasses.kt | 108 +++++++++++++ .../kotlin/fir/lazy/Fir2IrLazyProperty.kt | 3 +- .../fir/lazy/Fir2IrLazyPropertyAccessor.kt | 4 +- .../fir/lazy/Fir2IrLazySimpleFunction.kt | 4 +- ...LightTreeBlackBoxCodegenTestGenerated.java | 6 + ...hIrFakeOverrideGeneratorTestGenerated.java | 6 + .../FirPsiBlackBoxCodegenTestGenerated.java | 6 + ...ntersectionOverrideBetweenValAndVar.ir.txt | 146 ++++++++++++++++++ .../intersectionOverrideBetweenValAndVar.kt | 24 +++ .../box/fir/assertEqualsFakeOverride.kt | 1 + .../codegen/box/specialBuiltins/charBuffer.kt | 1 - .../codegen/BlackBoxCodegenTestGenerated.java | 6 + .../IrBlackBoxCodegenTestGenerated.java | 6 + ...kBoxCodegenWithIrInlinerTestGenerated.java | 6 + .../LightAnalysisModeTestGenerated.java | 5 + .../fir/FirJsCodegenBoxTestGenerated.java | 6 + .../fir/FirJsES6CodegenBoxTestGenerated.java | 6 + .../test/ir/IrJsCodegenBoxTestGenerated.java | 6 + .../ir/IrJsES6CodegenBoxTestGenerated.java | 6 + .../FirNativeCodegenBoxTestGenerated.java | 6 + .../FirNativeCodegenBoxTestNoPLGenerated.java | 6 + .../NativeCodegenBoxTestGenerated.java | 6 + .../NativeCodegenBoxTestNoPLGenerated.java | 6 + .../test/FirWasmCodegenBoxTestGenerated.java | 6 + .../test/K1WasmCodegenBoxTestGenerated.java | 6 + 31 files changed, 408 insertions(+), 11 deletions(-) create mode 100644 compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrSymbolsMappingForLazyClasses.kt create mode 100644 compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt create mode 100644 compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java index 5bc41bbaa53..20dfcdbed6c 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirBlackBoxCodegenBasedTestGenerated.java @@ -19226,6 +19226,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java index 299e80dc2b1..1671c27d713 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/LLFirReversedBlackBoxCodegenBasedTestGenerated.java @@ -19226,6 +19226,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/pipeline/convertToIr.kt b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/pipeline/convertToIr.kt index 9437c400c4b..c9a97ad8ea6 100644 --- a/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/pipeline/convertToIr.kt +++ b/compiler/fir/entrypoint/src/org/jetbrains/kotlin/fir/pipeline/convertToIr.kt @@ -118,6 +118,8 @@ fun FirResult.convertToIrAndActualize( if (components.configuration.useIrFakeOverrideBuilder) { val fakeOverrideResolver = SpecialFakeOverrideSymbolsResolver(expectActualMap) irModuleFragment.acceptVoid(SpecialFakeOverrideSymbolsResolverVisitor(fakeOverrideResolver)) + @OptIn(Fir2IrSymbolsMappingForLazyClasses.SymbolRemapperInternals::class) + components.symbolsMappingForLazyClasses.initializeSymbolMap(fakeOverrideResolver) } Fir2IrConverter.evaluateConstants(irModuleFragment, components) val actualizationResult = irActualizer?.runChecksAndFinalize(expectActualMap) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponents.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponents.kt index 60ab8987f89..fd081afcdef 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponents.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponents.kt @@ -54,6 +54,7 @@ interface Fir2IrComponents { val fakeOverrideGenerator: FakeOverrideGenerator val delegatedMemberGenerator: DelegatedMemberGenerator val fakeOverrideBuilder: IrFakeOverrideBuilder + val symbolsMappingForLazyClasses: Fir2IrSymbolsMappingForLazyClasses val extensions: Fir2IrExtensions val configuration: Fir2IrConfiguration diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponentsStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponentsStorage.kt index 2ea264dc1da..5992973a68a 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponentsStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrComponentsStorage.kt @@ -63,6 +63,7 @@ class Fir2IrComponentsStorage( override val callGenerator: CallAndReferenceGenerator = CallAndReferenceGenerator(this, fir2IrVisitor, conversionScope) override val fakeOverrideGenerator: FakeOverrideGenerator = FakeOverrideGenerator(this, conversionScope) override val delegatedMemberGenerator: DelegatedMemberGenerator = DelegatedMemberGenerator(this) + override val symbolsMappingForLazyClasses: Fir2IrSymbolsMappingForLazyClasses = Fir2IrSymbolsMappingForLazyClasses() override val annotationsFromPluginRegistrar: Fir2IrIrGeneratedDeclarationsRegistrar = Fir2IrIrGeneratedDeclarationsRegistrar(this) 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 9e9c1d11657..28bbaa403fb 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 @@ -286,7 +286,7 @@ class Fir2IrDeclarationStorage( ) { signature -> symbolTable.referenceSimpleFunctionIfAny(signature) } - return cachedIrCallable + return cachedIrCallable?.let(symbolsMappingForLazyClasses::remapFunctionSymbol) } /** @@ -715,14 +715,15 @@ class Fir2IrDeclarationStorage( ): IrPropertySymbol? { @Suppress("NAME_SHADOWING") val property = prepareProperty(property) - return getCachedIrCallableSymbol( + val symbol = getCachedIrCallableSymbol( property, fakeOverrideOwnerLookupTag, propertyCache, signatureCalculator ) { signature -> symbolTable.referencePropertyIfAny(signature) - } + } ?: return null + return symbolsMappingForLazyClasses.remapPropertySymbol(symbol) } private fun getCachedIrPropertySymbols( @@ -740,11 +741,11 @@ class Fir2IrDeclarationStorage( } fun findGetterOfProperty(propertySymbol: IrPropertySymbol): IrSimpleFunctionSymbol? { - return getterForPropertyCache[propertySymbol] + return getterForPropertyCache[propertySymbol]?.let(symbolsMappingForLazyClasses::remapFunctionSymbol) } fun findSetterOfProperty(propertySymbol: IrPropertySymbol): IrSimpleFunctionSymbol? { - return setterForPropertyCache[propertySymbol] + return setterForPropertyCache[propertySymbol]?.let(symbolsMappingForLazyClasses::remapFunctionSymbol) } fun findBackingFieldOfProperty(propertySymbol: IrPropertySymbol): IrFieldSymbol? { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrSymbolsMappingForLazyClasses.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrSymbolsMappingForLazyClasses.kt new file mode 100644 index 00000000000..716e1529c2f --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrSymbolsMappingForLazyClasses.kt @@ -0,0 +1,108 @@ +/* + * Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import org.jetbrains.kotlin.ir.IrLock +import org.jetbrains.kotlin.ir.declarations.lazy.lazyVar +import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol +import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol +import org.jetbrains.kotlin.ir.util.SymbolRemapper +import kotlin.properties.ReadWriteProperty +import kotlin.reflect.KProperty + +/** + * Some later stages of the Fir2Ir process (namely building fake overrides) + * need to remap some symbols. + * + * This remapping should be back-propagated to storages, so they would return + * remapped values. This is important for Lazy Classes and potentially important + * for plugins. + * + * This class serves this purpose. These parts can register a remapping, + * and corresponding symbols would be lazily updated in lazy declarations + * and in return values of storages. + */ +class Fir2IrSymbolsMappingForLazyClasses { + private var symbolMap = mutableListOf() + + /** + * This value can be used for fast check if something changed since last time. + * It should have new unique values on each change of class' state. + * + * As for now, only adds are supported, so the size of the list works as this unique number. + * + * Typical usage should cache the mapping result, and invalidate cache if and only if this value has changed. + */ + val generation: Int get() = symbolMap.size + + fun remapFunctionSymbol(symbol: IrSimpleFunctionSymbol): IrSimpleFunctionSymbol { + return symbolMap.fold(symbol) { s, m -> m.getReferencedSimpleFunction(s) } + } + + fun remapPropertySymbol(symbol: IrPropertySymbol): IrPropertySymbol { + return symbolMap.fold(symbol) { s, m -> m.getReferencedProperty(s) } + } + + @RequiresOptIn + annotation class SymbolRemapperInternals + + @SymbolRemapperInternals + fun initializeSymbolMap(map: SymbolRemapper) { + symbolMap.add(map) + } +} + +internal class MappedLazyVar( + val lock: IrLock, + initializer: () -> T, + val map: Fir2IrSymbolsMappingForLazyClasses, + val mapperFun: Fir2IrSymbolsMappingForLazyClasses.(T) -> T +) : ReadWriteProperty { + private val lazy = lazyVar(lock, initializer) + @Volatile private var lastSeenGeneration: Int = -1 + + override fun toString(): String = lazy.toString() + + override fun getValue(thisRef: Any?, property: KProperty<*>): T { + return synchronized(lock) { + if (lastSeenGeneration != map.generation) { + lazy.setValue(thisRef, property, map.mapperFun(lazy.getValue(thisRef, property))) + lastSeenGeneration = map.generation + } + lastSeenGeneration = map.generation + lazy.getValue(thisRef, property) + } + } + + override fun setValue(thisRef: Any?, property: KProperty<*>, value: T) { + synchronized(lock) { + lazy.setValue(thisRef, property, value) + lastSeenGeneration = map.generation + } + } +} + +fun Fir2IrSymbolsMappingForLazyClasses.lazyMappedVar( + lock: IrLock, + initializer: () -> T, + mapFunction: Fir2IrSymbolsMappingForLazyClasses.(T) -> T +): ReadWriteProperty { + return MappedLazyVar(lock, initializer, this, mapFunction) +} + +fun Fir2IrSymbolsMappingForLazyClasses.lazyMappedFunctionListVar( + lock: IrLock, + initializer: () -> List +): ReadWriteProperty> = lazyMappedVar(lock, initializer) { list -> + list.map { remapFunctionSymbol(it) } +} + +fun Fir2IrSymbolsMappingForLazyClasses.lazyMappedPropertyListVar( + lock: IrLock, + initializer: () -> List +): ReadWriteProperty> = lazyMappedVar(lock, initializer) { list -> + list.map { remapPropertySymbol(it) } +} \ No newline at end of file diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt index d157ea380cc..c23da00c9aa 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt @@ -22,7 +22,6 @@ import org.jetbrains.kotlin.fir.types.coneType import org.jetbrains.kotlin.fir.types.resolvedType import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI import org.jetbrains.kotlin.ir.declarations.* -import org.jetbrains.kotlin.ir.declarations.lazy.lazyVar import org.jetbrains.kotlin.ir.expressions.IrConstructorCall import org.jetbrains.kotlin.ir.expressions.IrExpressionBody import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol @@ -213,7 +212,7 @@ class Fir2IrLazyProperty( } } - override var overriddenSymbols: List by lazyVar(lock) { + override var overriddenSymbols: List by symbolsMappingForLazyClasses.lazyMappedPropertyListVar(lock) { when (configuration.useIrFakeOverrideBuilder) { true -> computeOverriddenSymbolsForIrFakeOverrideGenerator() false -> computeOverriddenUsingFir2IrFakeOverrideGenerator() diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt index b04684f64ef..53534af0451 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyPropertyAccessor.kt @@ -109,8 +109,8 @@ class Fir2IrLazyPropertyAccessor( } } - override var overriddenSymbols: List by lazyVar(lock) { - if (firParentClass == null) return@lazyVar emptyList() + override var overriddenSymbols: List by symbolsMappingForLazyClasses.lazyMappedFunctionListVar(lock) { + if (firParentClass == null) return@lazyMappedFunctionListVar emptyList() // If property accessor is created then corresponding property is definitely created too @OptIn(UnsafeDuringIrConstructionAPI::class) val correspondingProperty = correspondingPropertySymbol!!.owner diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt index c2d22a30d52..1600f657e40 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazySimpleFunction.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.fir.backend.Fir2IrComponents import org.jetbrains.kotlin.fir.backend.contextReceiversForFunctionOrContainingProperty import org.jetbrains.kotlin.fir.backend.generators.Fir2IrCallableDeclarationsGenerator import org.jetbrains.kotlin.fir.backend.generators.generateOverriddenFunctionSymbols +import org.jetbrains.kotlin.fir.backend.lazyMappedFunctionListVar import org.jetbrains.kotlin.fir.backend.toIrType import org.jetbrains.kotlin.fir.declarations.FirFunction import org.jetbrains.kotlin.fir.declarations.FirRegularClass @@ -92,13 +93,14 @@ class Fir2IrLazySimpleFunction( } } - override var overriddenSymbols: List by lazyVar(lock) { + override var overriddenSymbols: List by symbolsMappingForLazyClasses.lazyMappedFunctionListVar(lock) { when (configuration.useIrFakeOverrideBuilder) { true -> computeOverriddenSymbolsForIrFakeOverrideGenerator() false -> computeOverriddenUsingFir2IrFakeOverrideGenerator() } } + // TODO: drop this function after migration to IR f/o generator will be complete (KT-64202) private fun computeOverriddenUsingFir2IrFakeOverrideGenerator(): List { if (firParent == null) return emptyList() diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java index 325fcaa1ac7..64941d6bf4c 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenTestGenerated.java @@ -19155,6 +19155,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java index 766a26d35ba..39829027c38 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated.java @@ -19155,6 +19155,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java index 91e22e9748b..29c029adfba 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/codegen/FirPsiBlackBoxCodegenTestGenerated.java @@ -19155,6 +19155,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt b/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt new file mode 100644 index 00000000000..d56e2ca93c9 --- /dev/null +++ b/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.ir.txt @@ -0,0 +1,146 @@ +FILE fqName: fileName:/intersectionOverrideBetweenValAndVar.kt + CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A + CONSTRUCTOR visibility:public <> () returnType:.A [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any]' + PROPERTY name:x visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.A) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.A + 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:B modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B + PROPERTY name:x visibility:public modality:ABSTRACT [var] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.B + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.B, :kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name: index:0 type:kotlin.String + 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:C modality:ABSTRACT visibility:public superTypes:[.A; .B] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C + CONSTRUCTOR visibility:public <> () returnType:.C [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:ABSTRACT visibility:public superTypes:[.A; .B]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] + overridden: + public abstract x: kotlin.String + public abstract x: kotlin.String + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.B) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] + overridden: + public abstract fun (): kotlin.String declared in .A + public abstract fun (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:.B + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.B, :kotlin.String) returnType:kotlin.Unit [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] + overridden: + public abstract fun (: kotlin.String): kotlin.Unit declared in .B + $this: VALUE_PARAMETER name: type:.B + VALUE_PARAMETER name: index:0 type:kotlin.String + 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 .A + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B + $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 .A + public open fun hashCode (): kotlin.Int declared in .B + $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 .A + public open fun toString (): kotlin.String declared in .B + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.C] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.D + CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.D [primary] + VALUE_PARAMETER name:x index:0 type:kotlin.String + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .C' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:D modality:FINAL visibility:public superTypes:[.C]' + PROPERTY name:x visibility:public modality:OPEN [var] + overridden: + public abstract x: kotlin.String + FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private + EXPRESSION_BODY + GET_VAR 'x: kotlin.String declared in .D.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.D) returnType:kotlin.String + correspondingProperty: PROPERTY name:x visibility:public modality:OPEN [var] + overridden: + public abstract fun (): kotlin.String declared in .C + $this: VALUE_PARAMETER name: type:.D + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .D' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private' type=kotlin.String origin=null + receiver: GET_VAR ': .D declared in .D.' type=.D origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.D, :kotlin.String) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:x visibility:public modality:OPEN [var] + overridden: + public abstract fun (: kotlin.String): kotlin.Unit declared in .C + $this: VALUE_PARAMETER name: type:.D + VALUE_PARAMETER name: index:0 type:kotlin.String + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .D declared in .D.' type=.D origin=null + value: GET_VAR ': kotlin.String declared in .D.' type=kotlin.String origin=null + 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 .C + $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 .C + $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 .C + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:test visibility:public modality:FINAL <> (c:.C) returnType:kotlin.Unit + VALUE_PARAMETER name:c index:0 type:.C + BLOCK_BODY + CALL 'public abstract fun (: kotlin.String): kotlin.Unit declared in .C' type=kotlin.Unit origin=EQ + $this: GET_VAR 'c: .C declared in .test' type=.C origin=null + : CONST String type=kotlin.String value="OK" + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:d type:.D [val] + CONSTRUCTOR_CALL 'public constructor (x: kotlin.String) declared in .D' type=.D origin=null + x: CONST String type=kotlin.String value="Fail" + CALL 'public final fun test (c: .C): kotlin.Unit declared in ' type=kotlin.Unit origin=null + c: GET_VAR 'val d: .D declared in .box' type=.D origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public open fun (): kotlin.String declared in .D' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'val d: .D declared in .box' type=.D origin=null diff --git a/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt b/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt new file mode 100644 index 00000000000..cdb3e2378d4 --- /dev/null +++ b/compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt @@ -0,0 +1,24 @@ +// DUMP_IR +// FIR_IDENTICAL + +abstract class A { + abstract val x: String +} + +interface B { + var x: String +} + +abstract class C : A(), B + +class D(override var x: String) : C() + +fun test(c: C) { + c.x = "OK" +} + +fun box(): String { + val d = D("Fail") + test(d) + return d.x +} diff --git a/compiler/testData/codegen/box/fir/assertEqualsFakeOverride.kt b/compiler/testData/codegen/box/fir/assertEqualsFakeOverride.kt index ebb6c4bcb5f..3733d852602 100644 --- a/compiler/testData/codegen/box/fir/assertEqualsFakeOverride.kt +++ b/compiler/testData/codegen/box/fir/assertEqualsFakeOverride.kt @@ -1,4 +1,5 @@ // TARGET_BACKEND: JVM_IR +// IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION: KT-64150 // FILE: AbstractBlackBoxCodegenTest.java public abstract class AbstractBlackBoxCodegenTest extends CodegenTestCase {} diff --git a/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt b/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt index 187c98ee328..0796b454772 100644 --- a/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt +++ b/compiler/testData/codegen/box/specialBuiltins/charBuffer.kt @@ -1,5 +1,4 @@ // TARGET_BACKEND: JVM -// IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION: KT-63489 // MODULE: lib // FILE: CharBuffer.java diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java index bc58475647d..ad8cdc9a137 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/BlackBoxCodegenTestGenerated.java @@ -18321,6 +18321,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java index b193ee98391..dce4a423165 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenTestGenerated.java @@ -19155,6 +19155,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java index e3192e1b352..7381e020940 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/codegen/IrBlackBoxCodegenWithIrInlinerTestGenerated.java @@ -19155,6 +19155,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index dab7db64486..4d67dd09745 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -15931,6 +15931,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { runTest("compiler/testData/codegen/box/fakeOverride/kt49371.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java index 58b0d4c3653..fc33a29d657 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsCodegenBoxTestGenerated.java @@ -14337,6 +14337,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java index 25047cb2300..d9ce5c54f8a 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirJsES6CodegenBoxTestGenerated.java @@ -14337,6 +14337,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java index 08d9d670d72..f0636f50021 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsCodegenBoxTestGenerated.java @@ -14337,6 +14337,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java index 02b12b7cf77..1417a38c4fd 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/IrJsES6CodegenBoxTestGenerated.java @@ -14337,6 +14337,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java index 230eb6f6e80..e5d5c55535e 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestGenerated.java @@ -15464,6 +15464,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java index 2cfcb339542..e123ceea981 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/FirNativeCodegenBoxTestNoPLGenerated.java @@ -15826,6 +15826,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java index 03d9bc9c854..1aab87fccf9 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestGenerated.java @@ -15102,6 +15102,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java index 2d3bd1ad681..48fb494100f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/test/blackbox/NativeCodegenBoxTestNoPLGenerated.java @@ -15465,6 +15465,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java index 42700ba9bca..d574d6c9681 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/FirWasmCodegenBoxTestGenerated.java @@ -14313,6 +14313,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java index 7e43f096cf8..24423740f51 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/K1WasmCodegenBoxTestGenerated.java @@ -14313,6 +14313,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/fakeOverride/intersectionInLocal.kt"); } + @Test + @TestMetadata("intersectionOverrideBetweenValAndVar.kt") + public void testIntersectionOverrideBetweenValAndVar() throws Exception { + runTest("compiler/testData/codegen/box/fakeOverride/intersectionOverrideBetweenValAndVar.kt"); + } + @Test @TestMetadata("kt49371.kt") public void testKt49371() throws Exception {