From 94c46d384ad8b4b44a35519208bef55ea34bb27c Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 14 Dec 2023 17:39:41 +0200 Subject: [PATCH] [FIR2IR] Properly calculate the type of delegated function call ``` interface A { fun foo(): T } class B(val a: A) : A by A { generated fun foo(): T' { return a.foo() // <------ } } ``` There was a problem that type of generated delegated call used an unsubstituted type of the original delegated declaration, which led to a situation when (see example) type of call `a.foo()` was not `T'` but `T`, which led to incorrect IR and further exceptions on backend ^KT-64257 Fixed ^KT-64284 Obsolete --- ...LFirBlackBoxCodegenBasedTestGenerated.java | 6 + ...rsedBlackBoxCodegenBasedTestGenerated.java | 6 + .../generators/DelegatedMemberGenerator.kt | 116 ++++++++++-------- ...LightTreeBlackBoxCodegenTestGenerated.java | 6 + ...hIrFakeOverrideGeneratorTestGenerated.java | 6 + .../FirPsiBlackBoxCodegenTestGenerated.java | 6 + .../delegationToIntersectionType2.kt | 2 +- .../genericFunctionInGenericInterface.kt | 15 +++ ...ithMultipleOverriddens_generics.fir.ir.txt | 4 +- .../delegatedGenericImplementation.fir.ir.txt | 8 +- .../ir/irText/declarations/kt35550.fir.ir.txt | 65 ---------- .../ir/irText/declarations/kt35550.fir.kt.txt | 22 ---- .../ir/irText/declarations/kt35550.kt | 1 + .../ir/irText/firProblems/kt43342.fir.ir.txt | 8 +- .../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 + 28 files changed, 206 insertions(+), 148 deletions(-) create mode 100644 compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt delete mode 100644 compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt 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 20dfcdbed6c..f6cc41c3f58 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 @@ -16784,6 +16784,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 1671c27d713..99c6dfbe549 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 @@ -16784,6 +16784,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() throws Exception { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt index 47f8d53815e..6752717e948 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt @@ -11,9 +11,11 @@ import org.jetbrains.kotlin.fir.backend.* import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.utils.modality import org.jetbrains.kotlin.fir.lazy.Fir2IrLazyClass +import org.jetbrains.kotlin.fir.resolve.defaultType import org.jetbrains.kotlin.fir.resolve.dfa.cfg.isLocalClassOrAnonymousObject import org.jetbrains.kotlin.fir.resolve.fullyExpandedType import org.jetbrains.kotlin.fir.resolve.scope +import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap import org.jetbrains.kotlin.fir.scopes.* import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol @@ -51,8 +53,9 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I private val basePropertySymbols: MutableMap> = mutableMapOf() private data class DeclarationBodyInfo( - val declaration: IrDeclaration, - val field: IrField, + val delegatedFirDeclaration: FirCallableDeclaration, + val delegatedIrDeclaration: IrDeclaration, + val irField: IrField, val delegateToSymbol: FirCallableSymbol<*>, val delegateToLookupTag: ConeClassLikeLookupTag? ) @@ -60,36 +63,36 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I private val bodiesInfo = mutableListOf() fun generateBodies() { - for ((declaration, irField, delegateToFirSymbol, delegateToLookupTag) in bodiesInfo) { - val delegatedDeclarationType = delegateToFirSymbol.fir.returnTypeRef.coneType.fullyExpandedType(session) - val callTypeCanBeNullable = Fir2IrImplicitCastInserter.typeCanBeEnhancedOrFlexibleNullable(delegatedDeclarationType) - when (declaration) { + for ((delegatedFirDeclaration, delegatedIrDeclaration, irField, delegateToFirSymbol, delegateToLookupTag) in bodiesInfo) { + when (delegatedIrDeclaration) { is IrSimpleFunction -> { val delegateToIrFunctionSymbol = declarationStorage.getIrFunctionSymbol( - delegateToFirSymbol as FirNamedFunctionSymbol, delegateToLookupTag + delegateToFirSymbol.unwrapCallRepresentative(delegateToLookupTag) as FirNamedFunctionSymbol, + delegateToLookupTag ) as? IrSimpleFunctionSymbol ?: continue val body = createDelegateBody( - irField, declaration, delegateToFirSymbol.fir, delegateToIrFunctionSymbol, - callTypeCanBeNullable, isSetter = false + irField, delegatedFirDeclaration, delegatedIrDeclaration, delegateToFirSymbol.fir, delegateToIrFunctionSymbol, + isSetter = false ) - declaration.body = body + delegatedIrDeclaration.body = body } is IrProperty -> { val delegateToIrPropertySymbol = declarationStorage.getIrPropertySymbol( - delegateToFirSymbol as FirPropertySymbol, delegateToLookupTag + delegateToFirSymbol.unwrapCallRepresentative(delegateToLookupTag) as FirPropertySymbol, + delegateToLookupTag ) as? IrPropertySymbol ?: continue val delegateToGetterSymbol = declarationStorage.findGetterOfProperty(delegateToIrPropertySymbol)!! - val getter = declaration.getter!! + val getter = delegatedIrDeclaration.getter!! getter.body = createDelegateBody( - irField, getter, delegateToFirSymbol.fir, delegateToGetterSymbol, - callTypeCanBeNullable, isSetter = false + irField, delegatedFirDeclaration, getter, delegateToFirSymbol.fir, delegateToGetterSymbol, + isSetter = false ) - if (declaration.isVar) { + if (delegatedIrDeclaration.isVar) { val delegateToSetterSymbol = declarationStorage.findSetterOfProperty(delegateToIrPropertySymbol)!! - val setter = declaration.setter!! + val setter = delegatedIrDeclaration.setter!! setter.body = createDelegateBody( - irField, setter, delegateToFirSymbol.fir, delegateToSetterSymbol, - callTypeCanBeNullable = false, isSetter = true + irField, delegatedFirDeclaration, setter, delegateToFirSymbol.fir, delegateToSetterSymbol, + isSetter = true ) } } @@ -130,20 +133,16 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I val delegateToLookupTag = delegateToSymbol.dispatchReceiverClassLookupTagOrNull() ?: return@processAllFunctions - val irSubFunction = generateDelegatedFunction( - subClass, firSubClass, functionSymbol.fir - ) - - bodiesInfo += DeclarationBodyInfo(irSubFunction, irField, delegateToSymbol, delegateToLookupTag) - declarationStorage.cacheDelegationFunction(functionSymbol.fir, irSubFunction) + val delegatedFunction = functionSymbol.fir + val irSubFunction = generateDelegatedFunction(subClass, firSubClass, delegatedFunction) + bodiesInfo += DeclarationBodyInfo(delegatedFunction, irSubFunction, irField, delegateToSymbol, delegateToLookupTag) + declarationStorage.cacheDelegationFunction(delegatedFunction, irSubFunction) } subClassScope.processAllProperties { propertySymbol -> if (propertySymbol !is FirPropertySymbol) return@processAllProperties - val unwrapped = - propertySymbol.unwrapDelegateTarget(subClassLookupTag, firField) - ?: return@processAllProperties + val unwrapped = propertySymbol.unwrapDelegateTarget(subClassLookupTag, firField) ?: return@processAllProperties val delegateToSymbol = findDelegateToSymbol( unwrapped.symbol, @@ -156,14 +155,11 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I delegateToScope::processOverriddenProperties ) ?: return@processAllProperties - val delegateToLookupTag = delegateToSymbol.dispatchReceiverClassLookupTagOrNull() - ?: return@processAllProperties - - val irSubProperty = generateDelegatedProperty( - subClass, firSubClass, propertySymbol.fir - ) - bodiesInfo += DeclarationBodyInfo(irSubProperty, irField, delegateToSymbol, delegateToLookupTag) - declarationStorage.cacheDelegatedProperty(propertySymbol.fir, irSubProperty) + val delegateToLookupTag = delegateToSymbol.dispatchReceiverClassLookupTagOrNull() ?: return@processAllProperties + val delegatedProperty = propertySymbol.fir + val irSubProperty = generateDelegatedProperty(subClass, firSubClass, delegatedProperty) + bodiesInfo += DeclarationBodyInfo(delegatedProperty, irSubProperty, irField, delegateToSymbol, delegateToLookupTag) + declarationStorage.cacheDelegatedProperty(delegatedProperty, irSubProperty) } } @@ -174,19 +170,24 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I ): S? { val unwrappedSymbol = symbol.unwrapUseSiteSubstitutionOverrides() var result: S? = null - // The purpose of this code is to find member in delegate-to scope - // which matches or overrides unwrappedSymbol (which is in turn taken from subclass scope). + /* + * The purpose of this code is to find member in delegate-to scope + * which matches or overrides unwrappedSymbol (which is in turn taken from subclass scope). + * + * Note that it's important to not unwrap call-site substitution override of the found function, because + * later it will be used to compute the proper substituted type for call of this function + */ processCallables(unwrappedSymbol.name) { candidateSymbol -> if (result != null) return@processCallables val unwrappedCandidateSymbol = candidateSymbol.unwrapUseSiteSubstitutionOverrides() if (unwrappedCandidateSymbol === unwrappedSymbol) { - result = unwrappedCandidateSymbol + result = candidateSymbol return@processCallables } processOverridden(candidateSymbol) { overriddenSymbol -> val unwrappedOverriddenSymbol = overriddenSymbol.unwrapUseSiteSubstitutionOverrides() if (unwrappedOverriddenSymbol === unwrappedSymbol) { - result = unwrappedCandidateSymbol + result = candidateSymbol ProcessorAction.STOP } else { ProcessorAction.NEXT @@ -277,23 +278,38 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I */ private fun createDelegateBody( irField: IrField, - delegateFunction: IrSimpleFunction, + delegatedFirDeclaration: FirCallableDeclaration, + delegatedIrFunction: IrSimpleFunction, originalFirDeclaration: FirCallableDeclaration, originalFunctionSymbol: IrSimpleFunctionSymbol, - callTypeCanBeNullable: Boolean, isSetter: Boolean ): IrBlockBody { val startOffset = SYNTHETIC_OFFSET val endOffset = SYNTHETIC_OFFSET val body = irFactory.createBlockBody(startOffset, endOffset) + val typeOrigin = when { originalFirDeclaration is FirPropertyAccessor && originalFirDeclaration.isSetter -> ConversionTypeOrigin.SETTER else -> ConversionTypeOrigin.DEFAULT } + val callTypeCanBeNullable: Boolean val callReturnType = when (isSetter) { - false -> originalFirDeclaration.returnTypeRef.toIrType(typeOrigin) - true -> irBuiltIns.unitType + false -> { + val substitution = originalFirDeclaration.typeParameters.zip(delegatedFirDeclaration.typeParameters) + .map { (original, delegated) -> + original.symbol to delegated.symbol.defaultType + }.toMap() + + val substitutor = substitutorByMap(substitution, session) + val substitutedType = substitutor.substituteOrSelf(originalFirDeclaration.returnTypeRef.coneType) + callTypeCanBeNullable = Fir2IrImplicitCastInserter.typeCanBeEnhancedOrFlexibleNullable(substitutedType) + substitutedType.toIrType(typeOrigin) + } + true -> { + callTypeCanBeNullable = false + irBuiltIns.unitType + } } val irCall = IrCallImpl( @@ -310,8 +326,8 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I irField.type, IrGetValueImpl( startOffset, endOffset, - delegateFunction.dispatchReceiverParameter?.type!!, - delegateFunction.dispatchReceiverParameter?.symbol!! + delegatedIrFunction.dispatchReceiverParameter?.type!!, + delegatedIrFunction.dispatchReceiverParameter?.symbol!! ) ) @@ -327,16 +343,16 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I } extensionReceiver = - delegateFunction.extensionReceiverParameter?.let { extensionReceiver -> + delegatedIrFunction.extensionReceiverParameter?.let { extensionReceiver -> IrGetValueImpl(startOffset, endOffset, extensionReceiver.type, extensionReceiver.symbol) } - delegateFunction.valueParameters.forEach { + delegatedIrFunction.valueParameters.forEach { putValueArgument(it.index, IrGetValueImpl(startOffset, endOffset, it.type, it.symbol)) } for (index in originalFirDeclaration.typeParameters.indices) { putTypeArgument( index, IrSimpleTypeImpl( - delegateFunction.typeParameters[index].symbol, + delegatedIrFunction.typeParameters[index].symbol, hasQuestionMark = false, arguments = emptyList(), annotations = emptyList() @@ -344,7 +360,7 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I ) } } - val resultType = delegateFunction.returnType + val resultType = delegatedIrFunction.returnType val irCastOrCall = if (callTypeCanBeNullable && !resultType.isNullable()) Fir2IrImplicitCastInserter.implicitNotNullCast(irCall) @@ -353,7 +369,7 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I if (isSetter || originalDeclarationReturnType.isUnit || originalDeclarationReturnType.isNothing) { body.statements.add(irCastOrCall) } else { - val irReturn = IrReturnImpl(startOffset, endOffset, irBuiltIns.nothingType, delegateFunction.symbol, irCastOrCall) + val irReturn = IrReturnImpl(startOffset, endOffset, irBuiltIns.nothingType, delegatedIrFunction.symbol, irCastOrCall) body.statements.add(irReturn) } return body 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 64941d6bf4c..87ebe16680e 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 @@ -16725,6 +16725,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 39829027c38..86dadf18782 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 @@ -16725,6 +16725,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 29c029adfba..434903885d4 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 @@ -16725,6 +16725,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() throws Exception { diff --git a/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.kt b/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.kt index 287c3039b72..cad1275b72f 100644 --- a/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.kt +++ b/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.kt @@ -23,4 +23,4 @@ fun test(c: C, d: D): String { return object: A by intersection {}.foo().toString() } -fun box() = test(C(), D()) \ No newline at end of file +fun box() = test(C(), D()) diff --git a/compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt b/compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt new file mode 100644 index 00000000000..964c34e97c9 --- /dev/null +++ b/compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt @@ -0,0 +1,15 @@ +// ISSUE: KT-64257 + +interface Base { + fun fold(initial: R, operation: (R, String) -> R): R = operation(initial, "K") +} + +interface Derived : Base + +class Impl : Derived + +fun box(): String { + val impl = Impl() + val delegated = object : Derived by impl {} + return delegated.fold("O") { a, b -> a + b } +} diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt index 86f667f9629..d0efdef2ec2 100644 --- a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt @@ -207,7 +207,7 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k $this: VALUE_PARAMETER name: type:.MC BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MC' - CALL 'public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' type=E6 of .MyArrayList origin=null + CALL 'public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null receiver: GET_VAR ': .MC declared in .MC.foo' type=.MC origin=null PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] @@ -220,7 +220,7 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k $this: VALUE_PARAMETER name: type:.MC BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MC' - CALL 'public open fun (): E6 of .MyArrayList declared in .MyArrayList' type=E6 of .MyArrayList origin=null + CALL 'public open fun (): E6 of .MyArrayList declared in .MyArrayList' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt index 2d6aa877113..9b43148836c 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt @@ -75,7 +75,7 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt $receiver: VALUE_PARAMETER name: type:C of .Test1. BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.Test1, C of .Test1.>? declared in .Test1' - CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.IBase, C of .IBase.>? origin=null + CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.Test1, C of .Test1.>? origin=null : C of .Test1. $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null @@ -92,7 +92,7 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.Test1.> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): D of .Test1.? declared in .Test1' - CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .IBase.? origin=null + CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .Test1.? origin=null : D of .Test1. $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null @@ -177,7 +177,7 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt $receiver: VALUE_PARAMETER name: type:C of .Test2. BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.Test2.>? declared in .Test2' - CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.IBase, C of .IBase.>? origin=null + CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.Test2.>? origin=null : C of .Test2. $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=.IBase origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null @@ -194,7 +194,7 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.Test2.> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): D of .Test2.? declared in .Test2' - CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .IBase.? origin=null + CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .Test2.? origin=null : D of .Test2. $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=.IBase origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt deleted file mode 100644 index 51361b971cd..00000000000 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt +++ /dev/null @@ -1,65 +0,0 @@ -FILE fqName: fileName:/kt35550.kt - CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I - PROPERTY name:id visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN ($this:.I, $receiver:T of .I.) returnType:T of .I. - correspondingProperty: PROPERTY name:id visibility:public modality:OPEN [val] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.I - $receiver: VALUE_PARAMETER name: type:T of .I. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): T of .I. declared in .I' - GET_VAR ': T of .I. declared in .I.' type=T of .I. 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 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:A modality:FINAL visibility:public superTypes:[.I] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (i:.I) returnType:.A [primary] - VALUE_PARAMETER name:i index:0 type:.I - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I]' - FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final] - EXPRESSION_BODY - GET_VAR 'i: .I declared in .A.' type=.I origin=null - PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - overridden: - public open id: T of .I. - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.A, $receiver:T of .A.) returnType:T of .A. - correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - overridden: - public open fun (): T of .I. declared in .I - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $this: VALUE_PARAMETER name: type:.A - $receiver: VALUE_PARAMETER name: type:T of .A. - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): T of .A. declared in .A' - CALL 'public open fun (): T of .I. declared in .I' type=T of .I. origin=null - : T of .A. - $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final]' type=.I origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A origin=null - $receiver: GET_VAR ': T of .A. declared in .A.' type=T of .A. 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 .I - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .I - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .I - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt deleted file mode 100644 index 53a0d3d66f3..00000000000 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt +++ /dev/null @@ -1,22 +0,0 @@ -interface I { - val T.id: T - get(): T { - return - } - -} - -class A : I { - constructor(i: I) /* primary */ { - super/*Any*/() - /* () */ - - } - - private /* final field */ val $$delegate_0: I = i - override val T.id: T - override get(): T { - return (.#$$delegate_0, ).() - } - -} diff --git a/compiler/testData/ir/irText/declarations/kt35550.kt b/compiler/testData/ir/irText/declarations/kt35550.kt index 06937b70091..217d073d144 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.kt +++ b/compiler/testData/ir/irText/declarations/kt35550.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface I { val T.id: T get() = this diff --git a/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt b/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt index f42ffaca7ed..a11d7d14bd1 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt @@ -48,7 +48,7 @@ FILE fqName: fileName:/kt43342.kt VALUE_PARAMETER name:key index:0 type:K of .ControlFlowInfo BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun get (key: K of .ControlFlowInfo): V of .ControlFlowInfo? declared in .ControlFlowInfo' - CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=V of kotlin.collections.Map? origin=null + CALL 'public abstract fun get (key: K of kotlin.collections.Map): V of kotlin.collections.Map? declared in kotlin.collections.Map' type=V of .ControlFlowInfo? origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.get' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null key: GET_VAR 'key: K of .ControlFlowInfo declared in .ControlFlowInfo.get' type=K of .ControlFlowInfo origin=null @@ -71,7 +71,7 @@ FILE fqName: fileName:/kt43342.kt $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map' type=kotlin.collections.Set> origin=null + CALL 'public abstract fun (): kotlin.collections.Set> declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo, V of .ControlFlowInfo>> origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null PROPERTY DELEGATED_MEMBER name:keys visibility:public modality:OPEN [val] @@ -84,7 +84,7 @@ FILE fqName: fileName:/kt43342.kt $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Set.ControlFlowInfo> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map' type=kotlin.collections.Set origin=null + CALL 'public abstract fun (): kotlin.collections.Set declared in kotlin.collections.Map' type=kotlin.collections.Set.ControlFlowInfo> origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] @@ -110,7 +110,7 @@ FILE fqName: fileName:/kt43342.kt $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Collection.ControlFlowInfo> declared in .ControlFlowInfo' - CALL 'public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map' type=kotlin.collections.Collection origin=null + CALL 'public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map' type=kotlin.collections.Collection.ControlFlowInfo> origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null FUN FAKE_OVERRIDE name:getOrDefault visibility:public modality:OPEN <> ($this:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>, key:K of .ControlFlowInfo, defaultValue:V of .ControlFlowInfo) returnType:V of .ControlFlowInfo [fake_override] 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 ad8cdc9a137..b0b0586f8f7 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 @@ -16359,6 +16359,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 dce4a423165..a5b48ebddc8 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 @@ -16725,6 +16725,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 7381e020940..d89a997a953 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 @@ -16725,6 +16725,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/delegation/doubleDelegationEqualsHashcode.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 4d67dd09745..c933a90fe37 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -13794,6 +13794,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/delegation/differentModules.kt"); } + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @TestMetadata("genericProperty.kt") public void testGenericProperty() throws Exception { runTest("compiler/testData/codegen/box/delegation/genericProperty.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 fc33a29d657..abfb09e3282 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 @@ -12681,6 +12681,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 d9ce5c54f8a..0d828a0df12 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 @@ -12681,6 +12681,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 f0636f50021..bd4d83f812b 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 @@ -12681,6 +12681,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 1417a38c4fd..be7e2639d94 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 @@ -12681,6 +12681,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 e5d5c55535e..df7be43395f 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 @@ -13736,6 +13736,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 e123ceea981..7454e5491db 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 @@ -14050,6 +14050,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 1aab87fccf9..aeb71426cba 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 @@ -13422,6 +13422,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 48fb494100f..2b47eaa88fb 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 @@ -13737,6 +13737,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 d574d6c9681..651c5a73e45 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 @@ -12657,6 +12657,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() 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 24423740f51..93adfdb238c 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 @@ -12657,6 +12657,12 @@ public class K1WasmCodegenBoxTestGenerated extends AbstractK1WasmCodegenBoxTest runTest("compiler/testData/codegen/box/delegation/delegationWithPrivateConstructor.kt"); } + @Test + @TestMetadata("genericFunctionInGenericInterface.kt") + public void testGenericFunctionInGenericInterface() throws Exception { + runTest("compiler/testData/codegen/box/delegation/genericFunctionInGenericInterface.kt"); + } + @Test @TestMetadata("genericProperty.kt") public void testGenericProperty() throws Exception {