From ca2492e1f81a50fff3fd5631edeb69f227b7d8c2 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Tue, 28 Feb 2023 13:11:28 +0200 Subject: [PATCH] [FIR2IR] Unwrap substitution overrides during generation of delegated members ^KT-55828 Fixed --- .../generators/DelegatedMemberGenerator.kt | 4 +- ...LightTreeBlackBoxCodegenTestGenerated.java | 12 + .../FirPsiBlackBoxCodegenTestGenerated.java | 12 + ...ithMultipleOverriddens_generics.fir.ir.txt | 248 +++++++++++++++++ ...rtyWithMultipleOverriddens_generics.ir.txt | 251 ++++++++++++++++++ ...ropertyWithMultipleOverriddens_generics.kt | 31 +++ ...hMultipleOverriddens_noGenerics.fir.ir.txt | 238 +++++++++++++++++ ...yWithMultipleOverriddens_noGenerics.ir.txt | 241 +++++++++++++++++ ...pertyWithMultipleOverriddens_noGenerics.kt | 31 +++ .../codegen/BlackBoxCodegenTestGenerated.java | 12 + .../IrBlackBoxCodegenTestGenerated.java | 12 + ...kBoxCodegenWithIrInlinerTestGenerated.java | 12 + .../LightAnalysisModeTestGenerated.java | 10 + .../js/test/JsCodegenBoxTestGenerated.java | 12 + .../fir/FirJsCodegenBoxTestGenerated.java | 12 + .../test/ir/IrJsCodegenBoxTestGenerated.java | 12 + .../ir/IrJsES6CodegenBoxTestGenerated.java | 12 + .../K2NativeCodegenBoxTestGenerated.java | 12 + .../NativeCodegenBoxTestGenerated.java | 12 + .../test/IrCodegenBoxWasmTestGenerated.java | 10 + 20 files changed, 1194 insertions(+), 2 deletions(-) create mode 100644 compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt create mode 100644 compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt create mode 100644 compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt create mode 100644 compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt create mode 100644 compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt create mode 100644 compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt 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 b6b93fce106..e1cbb70161e 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 @@ -109,7 +109,7 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I ?: return@processAllFunctions val delegateToSymbol = findDelegateToSymbol( - unwrapped.symbol, + unwrapped.unwrapSubstitutionOverrides().symbol, delegateToScope::processFunctionsByName, delegateToScope::processOverriddenFunctions ) ?: return@processAllFunctions @@ -130,7 +130,7 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I ?: return@processAllProperties val delegateToSymbol = findDelegateToSymbol( - unwrapped.symbol, + unwrapped.unwrapSubstitutionOverrides().symbol, { name, processor -> delegateToScope.processPropertiesByName(name) { if (it !is FirPropertySymbol) return@processPropertiesByName 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 e28a5a705da..81e9efec15c 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 @@ -18919,6 +18919,18 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() 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 6f712b0cfa5..b908f479f6c 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 @@ -18919,6 +18919,18 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() throws Exception { diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt new file mode 100644 index 00000000000..4c1e9b05641 --- /dev/null +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt @@ -0,0 +1,248 @@ +FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.kt + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection.MyCollection> + TYPE_PARAMETER name:E1 index:0 variance:out superTypes:[kotlin.Any?] reified:false + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + 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 [operator] 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:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> + TYPE_PARAMETER name:E2 index:0 variance:out superTypes:[kotlin.Any?] reified:false + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: E1 of .MyCollection [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyMutableCollection>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection.MyMutableCollection> + TYPE_PARAMETER name:E3 index:0 variance: superTypes:[kotlin.Any?] reified:false + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E3 of .MyMutableCollection [fake_override] + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E1 of .MyCollection [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E3 of .MyMutableCollection [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList.MyMutableList>; .MyMutableCollection.MyMutableList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList.MyMutableList> + TYPE_PARAMETER name:E4 index:0 variance: superTypes:[kotlin.Any?] reified:false + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E4 of .MyMutableList [fake_override] + overridden: + public abstract fun foo (): E2 of .MyList declared in .MyList + $this: VALUE_PARAMETER name: type:.MyList.MyList> + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E2 of .MyList [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E4 of .MyMutableList [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E2 of .MyList declared in .MyList + $this: VALUE_PARAMETER name: type:.MyList.MyList> + 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 [fake_override,operator] declared in .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun toString (): kotlin.String [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection.MyAbstractCollection> + TYPE_PARAMETER name:E5 index:0 variance:out superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection.MyAbstractCollection> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>]' + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: E1 of .MyCollection [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList.MyArrayList> + TYPE_PARAMETER name:E6 index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList.MyArrayList> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () [primary] declared in .MyAbstractCollection' + : E6 of .MyArrayList + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>]' + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList + overridden: + public abstract fun foo (): E4 of .MyMutableList [fake_override] declared in .MyMutableList + public abstract fun foo (): E5 of .MyAbstractCollection declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' + TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList + CONST String type=kotlin.String value="O" + PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: E4 of .MyMutableList [fake_override,val] + public abstract bar: E5 of .MyAbstractCollection [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final] + EXPRESSION_BODY + TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): E4 of .MyMutableList [fake_override] declared in .MyMutableList + public abstract fun (): E5 of .MyAbstractCollection declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): E6 of .MyArrayList declared in .MyArrayList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final]' type=E6 of .MyArrayList origin=null + receiver: GET_VAR ': .MyArrayList.MyArrayList> declared in .MyArrayList.' type=.MyArrayList.MyArrayList> 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 [fake_override,operator] declared in .MyMutableList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun toString (): kotlin.String [fake_override] declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC + CONSTRUCTOR visibility:public <> () returnType:.MC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + overridden: + public abstract fun foo (): E3 of .MyMutableCollection [fake_override] declared in .MyMutableCollection + $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=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] + overridden: + public abstract bar: E3 of .MyMutableCollection [fake_override,val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): E3 of .MyMutableCollection [fake_override] declared in .MyMutableCollection + $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=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 + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MyArrayList' type=.MyArrayList origin=null + : 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 [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:x type:.MC [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MC' type=.MC origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS + $this: CALL 'public open fun foo (): kotlin.String declared in .MC' type=kotlin.String origin=null + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null + other: CALL 'public open fun (): kotlin.String declared in .MC' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt new file mode 100644 index 00000000000..b04c654f4f3 --- /dev/null +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.ir.txt @@ -0,0 +1,251 @@ +FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.kt + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection.MyCollection> + TYPE_PARAMETER name:E1 index:0 variance:out superTypes:[kotlin.Any?] reified:false + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyCollection>) returnType:E1 of .MyCollection + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection.MyCollection> + 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 [operator] 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:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList.MyList> + TYPE_PARAMETER name:E2 index:0 variance:out superTypes:[kotlin.Any?] reified:false + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: E1 of .MyCollection [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyList>) returnType:E2 of .MyList + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList.MyList> + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyMutableCollection>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection.MyMutableCollection> + TYPE_PARAMETER name:E3 index:0 variance: superTypes:[kotlin.Any?] reified:false + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E1 of .MyCollection [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection.MyMutableCollection>) returnType:E3 of .MyMutableCollection [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection.MyMutableCollection> + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList.MyMutableList>; .MyMutableCollection.MyMutableList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList.MyMutableList> + TYPE_PARAMETER name:E4 index:0 variance: superTypes:[kotlin.Any?] reified:false + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] + overridden: + public abstract fun foo (): E2 of .MyList declared in .MyList + public abstract fun foo (): E3 of .MyMutableCollection [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: E2 of .MyList [val] + public abstract bar: E3 of .MyMutableCollection [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList.MyMutableList>) returnType:E4 of .MyMutableList [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): E2 of .MyList declared in .MyList + public abstract fun (): E3 of .MyMutableCollection [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList.MyMutableList> + 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 [fake_override,operator] declared in .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun toString (): kotlin.String [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection.MyAbstractCollection> + TYPE_PARAMETER name:E5 index:0 variance:out superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection.MyAbstractCollection> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection.MyAbstractCollection>]' + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection + overridden: + public abstract fun foo (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: E1 of .MyCollection [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection.MyAbstractCollection>) returnType:E5 of .MyAbstractCollection + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): E1 of .MyCollection declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection.MyAbstractCollection> + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList.MyArrayList> + TYPE_PARAMETER name:E6 index:0 variance: superTypes:[kotlin.Any?] reified:false + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList.MyArrayList> [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () [primary] declared in .MyAbstractCollection' + : E6 of .MyArrayList + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList.MyArrayList>; .MyAbstractCollection.MyArrayList>]' + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList + overridden: + public abstract fun foo (): E4 of .MyMutableList [fake_override] declared in .MyMutableList + public abstract fun foo (): E5 of .MyAbstractCollection declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): E6 of .MyArrayList declared in .MyArrayList' + TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList + CONST String type=kotlin.String value="O" + PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: E4 of .MyMutableList [fake_override,val] + public abstract bar: E5 of .MyAbstractCollection [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final] + EXPRESSION_BODY + TYPE_OP type=E6 of .MyArrayList origin=CAST typeOperand=E6 of .MyArrayList + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList.MyArrayList>) returnType:E6 of .MyArrayList + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): E4 of .MyMutableList [fake_override] declared in .MyMutableList + public abstract fun (): E5 of .MyAbstractCollection declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList.MyArrayList> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): E6 of .MyArrayList declared in .MyArrayList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:E6 of .MyArrayList visibility:private [final]' type=E6 of .MyArrayList origin=null + receiver: GET_VAR ': .MyArrayList.MyArrayList> declared in .MyArrayList.' type=.MyArrayList.MyArrayList> 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 [fake_override,operator] declared in .MyMutableList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun toString (): kotlin.String [fake_override] declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC + CONSTRUCTOR visibility:public <> () returnType:.MC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MyArrayList' type=.MyArrayList origin=null + : kotlin.String + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: E3 of .MyMutableCollection [fake_override,val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): E3 of .MyMutableCollection [fake_override] declared in .MyMutableCollection + $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=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 DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + overridden: + public abstract fun foo (): E3 of .MyMutableCollection [fake_override] declared in .MyMutableCollection + $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=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 + 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 [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:x type:.MC [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MC' type=.MC origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS + $this: CALL 'public open fun foo (): kotlin.String declared in .MC' type=kotlin.String origin=null + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null + other: CALL 'public open fun (): kotlin.String declared in .MC' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt new file mode 100644 index 00000000000..69ebf5ccf85 --- /dev/null +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt @@ -0,0 +1,31 @@ +// ISSUE: KT-55828 +// DUMP_IR +interface MyCollection { + fun foo(): E1 + val bar: E1 +} + +interface MyList : MyCollection { + override fun foo(): E2 + override val bar: E2 +} + +interface MyMutableCollection : MyCollection +interface MyMutableList : MyList, MyMutableCollection + +abstract class MyAbstractCollection protected constructor() : MyCollection { + abstract override fun foo(): E5 + abstract override val bar: E5 +} + +class MyArrayList : MyMutableList, MyAbstractCollection() { + override fun foo(): E6 = "O" as E6 + override val bar: E6 = "K" as E6 +} + +class MC : MyMutableCollection by MyArrayList() + +fun box(): String { + val x = MC() + return x.foo() + x.bar +} diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt new file mode 100644 index 00000000000..9f73e6309b9 --- /dev/null +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt @@ -0,0 +1,238 @@ +FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics.kt + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.MyCollection + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection + 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 [operator] 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:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: kotlin.String [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList; .MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyList + $this: VALUE_PARAMETER name: type:.MyList + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyList + $this: VALUE_PARAMETER name: type:.MyList + 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 [fake_override,operator] declared in .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun toString (): kotlin.String [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection + CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection]' + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: kotlin.String [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () [primary] declared in .MyAbstractCollection' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection]' + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String [fake_override] declared in .MyMutableList + public abstract fun foo (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MyArrayList' + CONST String type=kotlin.String value="O" + PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: kotlin.String [fake_override,val] + public abstract bar: kotlin.String [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String [fake_override] declared in .MyMutableList + public abstract fun (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MyArrayList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyArrayList declared in .MyArrayList.' type=.MyArrayList 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 [fake_override,operator] declared in .MyMutableList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun toString (): kotlin.String [fake_override] declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC + CONSTRUCTOR visibility:public <> () returnType:.MC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String [fake_override] declared in .MyMutableCollection + $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 (): kotlin.String 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] + overridden: + public abstract bar: kotlin.String [fake_override,val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String [fake_override] declared in .MyMutableCollection + $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 (): kotlin.String 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 + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MyArrayList' type=.MyArrayList 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 [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:x type:.MC [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MC' type=.MC origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS + $this: CALL 'public open fun foo (): kotlin.String declared in .MC' type=kotlin.String origin=null + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null + other: CALL 'public open fun (): kotlin.String declared in .MC' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt new file mode 100644 index 00000000000..3c1f741d1ff --- /dev/null +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.ir.txt @@ -0,0 +1,241 @@ +FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics.kt + CLASS INTERFACE name:MyCollection modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyCollection + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + $this: VALUE_PARAMETER name: type:.MyCollection + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + $this: VALUE_PARAMETER name: type:.MyCollection + 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 [operator] 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:MyList modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyList + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: kotlin.String [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyList + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableCollection + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyCollection) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyCollection + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS INTERFACE name:MyMutableList modality:ABSTRACT visibility:public superTypes:[.MyList; .MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyMutableList + FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + overridden: + public abstract fun foo (): kotlin.String declared in .MyList + public abstract fun foo (): kotlin.String [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract bar: kotlin.String [val] + public abstract bar: kotlin.String [fake_override,val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.MyList) returnType:kotlin.String [fake_override] + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [fake_override,val] + overridden: + public abstract fun (): kotlin.String declared in .MyList + public abstract fun (): kotlin.String [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:.MyList + 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 [fake_override,operator] declared in .MyList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyList + public open fun toString (): kotlin.String [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyAbstractCollection + CONSTRUCTOR visibility:protected <> () returnType:.MyAbstractCollection [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyAbstractCollection modality:ABSTRACT visibility:public superTypes:[.MyCollection]' + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection + PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract bar: kotlin.String [val] + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.MyAbstractCollection) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .MyCollection + $this: VALUE_PARAMETER name: type:.MyAbstractCollection + 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 [fake_override,operator] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $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 [fake_override] declared in .MyCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyArrayList + CONSTRUCTOR visibility:public <> () returnType:.MyArrayList [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'protected constructor () [primary] declared in .MyAbstractCollection' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyArrayList modality:FINAL visibility:public superTypes:[.MyMutableList; .MyAbstractCollection]' + FUN name:foo visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String [fake_override] declared in .MyMutableList + public abstract fun foo (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .MyArrayList' + CONST String type=kotlin.String value="O" + PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: kotlin.String [fake_override,val] + public abstract bar: kotlin.String [val] + FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final] + EXPRESSION_BODY + CONST String type=kotlin.String value="K" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:OPEN <> ($this:.MyArrayList) returnType:kotlin.String + correspondingProperty: PROPERTY name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String [fake_override] declared in .MyMutableList + public abstract fun (): kotlin.String declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:.MyArrayList + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .MyArrayList' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.String visibility:private [final]' type=kotlin.String origin=null + receiver: GET_VAR ': .MyArrayList declared in .MyArrayList.' type=.MyArrayList 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 [fake_override,operator] declared in .MyMutableList + public open fun equals (other: kotlin.Any?): kotlin.Boolean [fake_override,operator] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun hashCode (): kotlin.Int [fake_override] declared in .MyAbstractCollection + $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 [fake_override] declared in .MyMutableList + public open fun toString (): kotlin.String [fake_override] declared in .MyAbstractCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MC + CONSTRUCTOR visibility:public <> () returnType:.MC [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MyArrayList' type=.MyArrayList origin=null + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract bar: kotlin.String [fake_override,val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.String [fake_override] declared in .MyMutableCollection + $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 (): kotlin.String 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 DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String + overridden: + public abstract fun foo (): kotlin.String [fake_override] declared in .MyMutableCollection + $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 (): kotlin.String 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 + 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 [fake_override,operator] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $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 [fake_override] declared in .MyMutableCollection + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String + BLOCK_BODY + VAR name:x type:.MC [val] + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .MC' type=.MC origin=null + RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' + CALL 'public final fun plus (other: kotlin.Any?): kotlin.String [operator] declared in kotlin.String' type=kotlin.String origin=PLUS + $this: CALL 'public open fun foo (): kotlin.String declared in .MC' type=kotlin.String origin=null + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null + other: CALL 'public open fun (): kotlin.String declared in .MC' type=kotlin.String origin=GET_PROPERTY + $this: GET_VAR 'val x: .MC [val] declared in .box' type=.MC origin=null diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt new file mode 100644 index 00000000000..486c512eae5 --- /dev/null +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt @@ -0,0 +1,31 @@ +// ISSUE: KT-55828 +// DUMP_IR +interface MyCollection { + fun foo(): String + val bar: String +} + +interface MyList : MyCollection { + override fun foo(): String + override val bar: String +} + +interface MyMutableCollection : MyCollection +interface MyMutableList : MyList, MyMutableCollection + +abstract class MyAbstractCollection protected constructor() : MyCollection { + abstract override fun foo(): String + abstract override val bar: String +} + +class MyArrayList : MyMutableList, MyAbstractCollection() { + override fun foo(): String = "O" + override val bar: String = "K" +} + +class MC : MyMutableCollection by MyArrayList() + +fun box(): String { + val x = MC() + return x.foo() + x.bar +} 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 d24a74cb168..a2f85fd6ca4 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 @@ -18067,6 +18067,18 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() 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 d321ff50cb8..675cdcea885 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 @@ -18919,6 +18919,18 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() 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 c0f1d301eaf..4f7dca1ae43 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 @@ -18919,6 +18919,18 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() 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 1d266e77a78..95f3468077d 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -14996,6 +14996,16 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @TestMetadata("ea33909.kt") public void testEa33909() throws Exception { runTest("compiler/testData/codegen/box/functions/ea33909.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java index 235037def48..5df7edf2c5f 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/JsCodegenBoxTestGenerated.java @@ -13917,6 +13917,18 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() throws Exception { 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 1607b1de7bd..8bcca17d5b0 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 @@ -14013,6 +14013,18 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() 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 8f04b89c95e..f371a671feb 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 @@ -14013,6 +14013,18 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() 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 26ca549b39b..b65cd5695b7 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 @@ -14013,6 +14013,18 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java index 74026778c98..c54584dcc09 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/K2NativeCodegenBoxTestGenerated.java @@ -15249,6 +15249,18 @@ public class K2NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTes runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java index 138dcb1c46c..b9c790a5eac 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/blackboxtest/NativeCodegenBoxTestGenerated.java @@ -15067,6 +15067,18 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @Test + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @Test @TestMetadata("ea33909.kt") public void testEa33909() throws Exception { diff --git a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java index a482209951c..f6860ad4ddb 100644 --- a/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java +++ b/wasm/wasm.tests/tests-gen/org/jetbrains/kotlin/wasm/test/IrCodegenBoxWasmTestGenerated.java @@ -12446,6 +12446,16 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest runTest("compiler/testData/codegen/box/functions/defaultargs7.kt"); } + @TestMetadata("delegatedPropertyWithMultipleOverriddens_generics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_generics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.kt"); + } + + @TestMetadata("delegatedPropertyWithMultipleOverriddens_noGenerics.kt") + public void testDelegatedPropertyWithMultipleOverriddens_noGenerics() throws Exception { + runTest("compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.kt"); + } + @TestMetadata("ea33909.kt") public void testEa33909() throws Exception { runTest("compiler/testData/codegen/box/functions/ea33909.kt");