diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java index ea3614ece42..3c7ae74d400 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/codegen/ir/FirBlackBoxCodegenTestGenerated.java @@ -13748,6 +13748,11 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir/serializationRegressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @TestMetadata("deepGenericDelegatedProperty.kt") + public void testDeepGenericDelegatedProperty() throws Exception { + runTest("compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt"); + } + @TestMetadata("dispatchReceiverValue.kt") public void testDispatchReceiverValue() throws Exception { runTest("compiler/testData/codegen/box/ir/serializationRegressions/dispatchReceiverValue.kt"); diff --git a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java index 663ccad3f00..07ad6aea525 100644 --- a/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests/org/jetbrains/kotlin/fir/Fir2IrTextTestGenerated.java @@ -1872,6 +1872,11 @@ public class Fir2IrTextTestGenerated extends AbstractFir2IrTextTest { runTest("compiler/testData/ir/irText/types/coercionToUnitInLambdaReturnValue.kt"); } + @TestMetadata("genericDelegatedDeepProperty.kt") + public void testGenericDelegatedDeepProperty() throws Exception { + runTest("compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt"); + } + @TestMetadata("genericFunWithStar.kt") public void testGenericFunWithStar() throws Exception { runTest("compiler/testData/ir/irText/types/genericFunWithStar.kt"); diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt index 95f469efab7..e04ba0a765a 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/DelegatedPropertyGenerator.kt @@ -65,7 +65,7 @@ class DelegatedPropertyGenerator(declarationGenerator: DeclarationGenerator) : D val irDelegate = irProperty.backingField!! val thisClass = propertyDescriptor.containingDeclaration as? ClassDescriptor - val delegateReceiverValue = createBackingFieldValueForDelegate(irDelegate.symbol, thisClass, ktDelegate) + val delegateReceiverValue = createBackingFieldValueForDelegate(irDelegate.symbol, thisClass, ktDelegate, propertyDescriptor) val getterDescriptor = propertyDescriptor.getter!! irProperty.getter = generateDelegatedPropertyAccessor(ktProperty, ktDelegate, getterDescriptor) { irGetter -> generateDelegatedPropertyGetterBody( @@ -120,24 +120,26 @@ class DelegatedPropertyGenerator(declarationGenerator: DeclarationGenerator) : D kPropertyType: KotlinType, ktDelegate: KtPropertyDelegate ): IrField { - val delegateType = getDelegatedPropertyDelegateType(propertyDescriptor, ktDelegate) - val delegateDescriptor = createPropertyDelegateDescriptor(propertyDescriptor, delegateType, kPropertyType) + return context.typeTranslator.withTypeErasure(propertyDescriptor) { + val delegateType = getDelegatedPropertyDelegateType(propertyDescriptor, ktDelegate) + val delegateDescriptor = createPropertyDelegateDescriptor(propertyDescriptor, delegateType, kPropertyType) - val startOffset = ktDelegate.startOffsetSkippingComments - val endOffset = ktDelegate.endOffset - val origin = IrDeclarationOrigin.PROPERTY_DELEGATE - val type = delegateDescriptor.type.toIrType() - return context.symbolTable.declareField( - startOffset, endOffset, origin, delegateDescriptor, type - ) { - IrFieldImpl(startOffset, endOffset, origin, it, type).apply { - metadata = MetadataSource.Property(propertyDescriptor) + val startOffset = ktDelegate.startOffsetSkippingComments + val endOffset = ktDelegate.endOffset + val origin = IrDeclarationOrigin.PROPERTY_DELEGATE + val type = delegateDescriptor.type.toIrType() + context.symbolTable.declareField( + startOffset, endOffset, origin, delegateDescriptor, type + ) { + IrFieldImpl(startOffset, endOffset, origin, it, type).apply { + metadata = MetadataSource.Property(propertyDescriptor) + } + }.also { irDelegate -> + irDelegate.initializer = generateInitializerBodyForPropertyDelegate( + propertyDescriptor, kPropertyType, ktDelegate, + irDelegate.symbol + ) } - }.also { irDelegate -> - irDelegate.initializer = generateInitializerBodyForPropertyDelegate( - propertyDescriptor, kPropertyType, ktDelegate, - irDelegate.symbol - ) } } @@ -166,17 +168,21 @@ class DelegatedPropertyGenerator(declarationGenerator: DeclarationGenerator) : D private fun createBackingFieldValueForDelegate( irDelegateField: IrFieldSymbol, thisClass: ClassDescriptor?, - ktDelegate: KtPropertyDelegate + ktDelegate: KtPropertyDelegate, + propertyDescriptor: PropertyDescriptor ): IntermediateValue { - val thisValue = createThisValueForDelegate(thisClass, ktDelegate) - return BackingFieldLValue( - context, - ktDelegate.startOffsetSkippingComments, ktDelegate.endOffset, - irDelegateField.descriptor.type.toIrType(), - irDelegateField, - thisValue, - null - ) + return context.typeTranslator.withTypeErasure(propertyDescriptor) { + // TODO: do not erase type here + val thisValue = createThisValueForDelegate(thisClass, ktDelegate) + BackingFieldLValue( + context, + ktDelegate.startOffsetSkippingComments, ktDelegate.endOffset, + irDelegateField.descriptor.type.toIrType(), + irDelegateField, + thisValue, + null + ) + } } private fun createThisValueForDelegate(thisClass: ClassDescriptor?, ktDelegate: KtPropertyDelegate): IntermediateValue? = diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt index 3b689c5296d..0dc5952fd5c 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/transformations/InsertImplicitCasts.kt @@ -203,10 +203,13 @@ internal class InsertImplicitCasts( initializer = initializer?.cast(declaration.descriptor.type) } - override fun visitField(declaration: IrField): IrStatement = - declaration.transformPostfix { - initializer?.coerceInnerExpression(descriptor.type) + override fun visitField(declaration: IrField): IrStatement { + return typeTranslator.withTypeErasure(declaration.correspondingPropertySymbol?.descriptor ?: declaration.descriptor) { + declaration.transformPostfix { + initializer?.coerceInnerExpression(descriptor.type) + } } + } override fun visitFunction(declaration: IrFunction): IrStatement = typeTranslator.buildWithScope(declaration) { diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt index 3c30da97025..daa973d77eb 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/TypeTranslator.kt @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.config.LanguageFeature import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.ClassDescriptor +import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.descriptors.TypeAliasDescriptor import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor import org.jetbrains.kotlin.descriptors.annotations.Annotations @@ -22,6 +23,7 @@ import org.jetbrains.kotlin.ir.types.impl.* import org.jetbrains.kotlin.types.* import org.jetbrains.kotlin.types.typeUtil.replaceArgumentsWithStarProjections import org.jetbrains.kotlin.types.typesApproximation.approximateCapturedTypes +import java.util.* class TypeTranslator( private val symbolTable: ReferenceSymbolTable, @@ -31,6 +33,8 @@ class TypeTranslator( private val enterTableScope: Boolean = false ) { + private val erasureStack = Stack() + private val typeApproximatorForNI = TypeApproximator(builtIns) lateinit var constantValueGenerator: ConstantValueGenerator @@ -48,6 +52,15 @@ class TypeTranslator( } } + fun withTypeErasure(propertyDescriptor: PropertyDescriptor, b: () -> T): T { + try { + erasureStack.push(propertyDescriptor) + return b() + } finally { + erasureStack.pop() + } + } + inline fun buildWithScope(container: IrTypeParametersContainer, builder: () -> T): T { enterScope(container) val result = builder() @@ -80,6 +93,17 @@ class TypeTranslator( val ktTypeDescriptor = ktTypeConstructor.declarationDescriptor ?: throw AssertionError("No descriptor for type $approximatedType") + if (erasureStack.isNotEmpty()) { + if (ktTypeDescriptor is TypeParameterDescriptor) { + if (ktTypeDescriptor.containingDeclaration in erasureStack) { + // This hack is about type parameter leak in case of generic delegated property + // Such code has to be prohibited since LV 1.5 + // For more details see commit message or KT-24643 + return approximateUpperBounds(ktTypeDescriptor.upperBounds, variance) + } + } + } + return IrSimpleTypeBuilder().apply { this.kotlinType = flexibleApproximatedType this.hasQuestionMark = approximatedType.isMarkedNullable @@ -103,6 +127,11 @@ class TypeTranslator( }.buildTypeProjection() } + private fun approximateUpperBounds(upperBounds: Collection, variance: Variance): IrTypeProjection { + val commonSupertype = CommonSupertypes.commonSupertype(upperBounds) + return translateType(approximate(commonSupertype.replaceArgumentsWithStarProjections()), variance) + } + private fun SimpleType.toIrTypeAbbreviation(): IrTypeAbbreviation { val typeAliasDescriptor = constructor.declarationDescriptor.let { it as? TypeAliasDescriptor diff --git a/compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt b/compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt new file mode 100644 index 00000000000..22930985a50 --- /dev/null +++ b/compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt @@ -0,0 +1,60 @@ +// IGNORE_BACKEND_FIR: JVM_IR +// IGNORE_BACKEND: NATIVE +//For KT-6020 + +// MODULE: lib +// FILE: lib.kt +import kotlin.reflect.KProperty1 +import kotlin.reflect.KMutableProperty1 +import kotlin.reflect.KProperty + +class Value>(var value1: T, val value2: IT) + +interface IDelegate1 { + operator fun getValue(t: T1, p: KProperty<*>): R1 +} + +interface IDelegate2 { + operator fun getValue(t: T2, p: KProperty<*>): R2 +} + +interface IR { + fun foo(): R +} + +class CR(val r: R) : IR { + override fun foo(): R = r +} + +class P(val p1: P1, val p2: P2) + +val Value>.additionalText by object : IDelegate1>, P> { + + fun qux11(t: F11T): F11T = t + + private val Value>.deepO by object : IDelegate1>, T> { + override fun getValue(t: Value>, p: KProperty<*>): T { + return qux11(t.value1) + } + } + + private val Value>.deepK by object : IDelegate1>, T> { + fun > qux22(t: F22T): T = t.foo() + + override fun getValue(t: Value>, p: KProperty<*>): T { + return qux22(t.value2) + } + } + + override fun getValue(t: Value>, p: KProperty<*>): P { + return P(t.deepO, t.deepK) + } +} + +// MODULE: main(lib) +// FILE: main.kt +fun box(): String { + val p = Value("O", CR("K")) + val rr = p.additionalText + return rr.p1 + rr.p2 +} \ No newline at end of file diff --git a/compiler/testData/codegen/box/ir/serializationRegressions/genericProperty.kt b/compiler/testData/codegen/box/ir/serializationRegressions/genericProperty.kt index e07ec7b7f59..a680bf1f161 100644 --- a/compiler/testData/codegen/box/ir/serializationRegressions/genericProperty.kt +++ b/compiler/testData/codegen/box/ir/serializationRegressions/genericProperty.kt @@ -1,6 +1,5 @@ // IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: NATIVE -// IGNORE_BACKEND: JS_IR //For KT-6020 // MODULE: lib diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.txt index 82aa48b82e5..c04cbbefafd 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.txt @@ -68,7 +68,7 @@ FILE fqName: fileName:/genericPropertyRef.kt FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, kotlin.String?> origin=null + kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value, kotlin.String?> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -83,7 +83,7 @@ FILE fqName: fileName:/genericPropertyRef.kt FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final value: T of .Value [var]' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value.>, T of .> origin=null + kmember: PROPERTY_REFERENCE 'public final value: T of .Value [var]' field=null getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value, kotlin.Any?> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt new file mode 100644 index 00000000000..587ed20c45a --- /dev/null +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.fir.txt @@ -0,0 +1,322 @@ +FILE fqName: fileName:/genericDelegatedDeepProperty.kt + CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Value.Value, IT of .Value> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:IT index:1 variance: superTypes:[.IR.Value>] + CONSTRUCTOR visibility:public <> (value1:T of .Value, value2:IT of .Value) returnType:.Value.Value, IT of .Value> [primary] + VALUE_PARAMETER name:value1 index:0 type:T of .Value + VALUE_PARAMETER name:value2 index:1 type:IT of .Value + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value1 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private + EXPRESSION_BODY + GET_VAR 'value1: T of .Value declared in .Value.' type=T of .Value origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value.Value, IT of .Value>) returnType:T of .Value + correspondingProperty: PROPERTY name:value1 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value.Value, IT of .Value> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Value declared in .Value' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private' type=T of .Value origin=null + receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value.Value, IT of .Value>, :T of .Value) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value1 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value.Value, IT of .Value> + VALUE_PARAMETER name: index:0 type:T of .Value + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> origin=null + value: GET_VAR ': T of .Value declared in .Value.' type=T of .Value origin=null + PROPERTY name:value2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value2 type:IT of .Value visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value2: IT of .Value declared in .Value.' type=IT of .Value origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value.Value, IT of .Value>) returnType:IT of .Value + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Value.Value, IT of .Value> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IT of .Value declared in .Value' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:IT of .Value visibility:private [final]' type=IT of .Value origin=null + receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> 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 [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:IDelegate1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:R1 index:1 variance: superTypes:[kotlin.Any?] + FUN name:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate1.IDelegate1, R1 of .IDelegate1>, t:T1 of .IDelegate1, p:kotlin.reflect.KProperty<*>) returnType:R1 of .IDelegate1 [operator] + $this: VALUE_PARAMETER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> + VALUE_PARAMETER name:t index:0 type:T1 of .IDelegate1 + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + 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:IDelegate2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:R2 index:1 variance: superTypes:[kotlin.Any?] + FUN name:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate2.IDelegate2, R2 of .IDelegate2>, t:T2 of .IDelegate2, p:kotlin.reflect.KProperty<*>) returnType:R2 of .IDelegate2 [operator] + $this: VALUE_PARAMETER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> + VALUE_PARAMETER name:t index:0 type:T2 of .IDelegate2 + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + 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:IR modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IR.IR> + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IR.IR>) returnType:R of .IR + $this: VALUE_PARAMETER name: type:.IR.IR> + 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 CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CR.CR> + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (r:R of .CR) returnType:.CR.CR> [primary] + VALUE_PARAMETER name:r index:0 type:R of .CR + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>]' + PROPERTY name:r visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final] + EXPRESSION_BODY + GET_VAR 'r: R of .CR declared in .CR.' type=R of .CR origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.CR.CR>) returnType:R of .CR + correspondingProperty: PROPERTY name:r visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): R of .CR declared in .CR' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final]' type=R of .CR origin=null + receiver: GET_VAR ': .CR.CR> declared in .CR.' type=.CR.CR> origin=null + FUN name:foo visibility:public modality:FINAL <> ($this:.CR.CR>) returnType:R of .CR + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun foo (): R of .CR declared in .CR' + CALL 'public final fun (): R of .CR declared in .CR' type=R of .CR origin=GET_PROPERTY + $this: GET_VAR ': .CR.CR> declared in .CR.foo' type=.CR.CR> 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 [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 CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P.P, P2 of .P> + TYPE_PARAMETER name:P1 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:P2 index:1 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (p1:P1 of .P, p2:P2 of .P) returnType:.P.P, P2 of .P> [primary] + VALUE_PARAMETER name:p1 index:0 type:P1 of .P + VALUE_PARAMETER name:p2 index:1 type:P2 of .P + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:p1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p1: P1 of .P declared in .P.' type=P1 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P1 of .P + correspondingProperty: PROPERTY name:p1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P1 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final]' type=P1 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null + PROPERTY name:p2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p2: P2 of .P declared in .P.' type=P2 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P2 of .P + correspondingProperty: PROPERTY name:p2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P2 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final]' type=P2 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> 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 [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 + PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, .P., T of .>>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate. + CONSTRUCTOR visibility:private <> () returnType:.additionalText$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, .P., T of .>>]' + FUN name:qux11 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F11T of .additionalText$delegate..qux11) returnType:F11T of .additionalText$delegate..qux11 + TYPE_PARAMETER name:F11T index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:F11T of .additionalText$delegate..qux11 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux11 (t: F11T of .additionalText$delegate..qux11): F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate.' + GET_VAR 't: F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate..qux11' type=F11T of .additionalText$delegate..qux11 origin=null + FUN name:qux12 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F12T of .additionalText$delegate..qux12) returnType:T of . + TYPE_PARAMETER name:F12T index:0 variance: superTypes:[.IR.>] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:F12T of .additionalText$delegate..qux12 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux12 (t: F12T of .additionalText$delegate..qux12): T of . declared in .additionalText$delegate.' + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=T of . origin=null + $this: GET_VAR 't: F12T of .additionalText$delegate..qux12 declared in .additionalText$delegate..qux12' type=F12T of .additionalText$delegate..qux12 origin=null + PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepO$delegate. + CONSTRUCTOR visibility:private <> () returnType:.additionalText$delegate..deepO$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>]' + FUN name:getValue visibility:public modality:FINAL <> ($this:.additionalText$delegate..deepO$delegate., t:.Value., .CR.>>, p:kotlin.reflect.KProperty<*>) returnType:T of . + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:.Value., .CR.>> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepO$delegate.' + CALL 'public final fun (): T of .Value declared in .Value' type=T of . origin=GET_PROPERTY + $this: GET_VAR 't: .Value., .CR.>> declared in .additionalText$delegate..deepO$delegate..getValue' type=.Value., .CR.>> origin=null + FUN name:qux21 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F21T of .additionalText$delegate..deepO$delegate..qux21) returnType:F21T of .additionalText$delegate..deepO$delegate..qux21 + TYPE_PARAMETER name:F21T index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:F21T of .additionalText$delegate..deepO$delegate..qux21 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux21 (t: F21T of .additionalText$delegate..deepO$delegate..qux21): F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate.' + GET_VAR 't: F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate..qux21' type=F21T of .additionalText$delegate..deepO$delegate..qux21 origin=null + FUN name:qux22 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F22T of .additionalText$delegate..deepO$delegate..qux22) returnType:T of . + TYPE_PARAMETER name:F22T index:0 variance: superTypes:[.IR.>] + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:F22T of .additionalText$delegate..deepO$delegate..qux22 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux22 (t: F22T of .additionalText$delegate..deepO$delegate..qux22): T of . declared in .additionalText$delegate..deepO$delegate.' + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=T of . origin=null + $this: GET_VAR 't: F22T of .additionalText$delegate..deepO$delegate..qux22 declared in .additionalText$delegate..deepO$delegate..qux22' type=F22T of .additionalText$delegate..deepO$delegate..qux22 origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value., .CR.>>) returnType:T of . + correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of . declared in .additionalText$delegate.' + CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepO$delegate.' type=T of . origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=GET_PROPERTY + t: ERROR_CALL 'Unresolved reference: this@R|/anonymous.deepO|' type=.Value., .CR.>> + p: PROPERTY_REFERENCE 'private final deepO: T of . [delegated,val]' field='FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepK$delegate. + CONSTRUCTOR visibility:private <> () returnType:.additionalText$delegate..deepK$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value., .CR.>>, T of .>]' + FUN name:getValue visibility:public modality:FINAL <> ($this:.additionalText$delegate..deepK$delegate., t:.Value., .CR.>>, p:kotlin.reflect.KProperty<*>) returnType:T of . + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepK$delegate. + VALUE_PARAMETER name:t index:0 type:.Value., .CR.>> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepK$delegate.' + CALL 'public final fun foo (): R of .CR declared in .CR' type=T of . origin=null + $this: CALL 'public final fun (): IT of .Value declared in .Value' type=.CR.> origin=GET_PROPERTY + $this: GET_VAR 't: .Value., .CR.>> declared in .additionalText$delegate..deepK$delegate..getValue' type=.Value., .CR.>> origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value., .CR.>>) returnType:T of . + correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of . declared in .additionalText$delegate.' + CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): T of . declared in .additionalText$delegate..deepK$delegate.' type=T of . origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=GET_PROPERTY + t: ERROR_CALL 'Unresolved reference: this@R|/anonymous.deepK|' type=.Value., .CR.>> + p: PROPERTY_REFERENCE 'private final deepK: T of . [delegated,val]' field='FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' getter='public final fun (): T of . declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty<*> origin=null + FUN name:getValue visibility:public modality:FINAL <> ($this:.additionalText$delegate., t:.Value., .CR.>>, p:kotlin.reflect.KProperty<*>) returnType:.P., T of .> + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:.Value., .CR.>> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): .P., T of .> declared in .additionalText$delegate.' + CONSTRUCTOR_CALL 'public constructor (p1: P1 of .P, p2: P2 of .P) [primary] declared in .P' type=.P., T of .> origin=null + : T of . + : T of . + p1: CALL 'public final fun (): T of . declared in .additionalText$delegate.' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate.' type=.additionalText$delegate. origin=null + $receiver: GET_VAR 't: .Value., .CR.>> declared in .additionalText$delegate..getValue' type=.Value., .CR.>> origin=null + p2: CALL 'public final fun (): T of . declared in .additionalText$delegate.' type=T of . origin=GET_PROPERTY + $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate.' type=.additionalText$delegate. origin=null + $receiver: GET_VAR 't: .Value., .CR.>> declared in .additionalText$delegate..getValue' type=.Value., .CR.>> origin=null + CONSTRUCTOR_CALL 'private constructor () [primary] declared in .additionalText$delegate.' type=.additionalText$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value., .CR.>>) returnType:.P., T of .> + correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .P., T of .> declared in ' + CALL 'public final fun getValue (t: .Value., .CR.>>, p: kotlin.reflect.KProperty<*>): .P., T of .> declared in .additionalText$delegate.' type=.P., T of .> origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static]' type=.additionalText$delegate. origin=GET_PROPERTY + t: ERROR_CALL 'Unresolved reference: this@R|/additionalText|' type=.Value., .CR.>> + p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .> [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static]' getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt new file mode 100644 index 00000000000..cb70c7f8c2d --- /dev/null +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt @@ -0,0 +1,48 @@ +import kotlin.reflect.KProperty1 +import kotlin.reflect.KMutableProperty1 +import kotlin.reflect.KProperty + +class Value>(var value1: T, val value2: IT) + +interface IDelegate1 { + operator fun getValue(t: T1, p: KProperty<*>): R1 +} + +interface IDelegate2 { + operator fun getValue(t: T2, p: KProperty<*>): R2 +} + +interface IR { + fun foo(): R +} + +class CR(val r: R) : IR { + override fun foo(): R = r +} + +class P(val p1: P1, val p2: P2) + +val Value>.additionalText by object : IDelegate1>, P> { + + fun qux11(t: F11T): F11T = t + fun > qux12(t: F12T): T = t.foo() + + private val Value>.deepO by object : IDelegate1>, T> { + override fun getValue(t: Value>, p: KProperty<*>): T { + return t.value1 + } + + fun qux21(t: F21T): F21T = t + fun > qux22(t: F22T): T = t.foo() + } + + private val Value>.deepK by object : IDelegate1>, T> { + override fun getValue(t: Value>, p: KProperty<*>): T { + return t.value2.foo() + } + } + + override fun getValue(t: Value>, p: KProperty<*>): P { + return P(t.deepO, t.deepK) + } +} diff --git a/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.txt b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.txt new file mode 100644 index 00000000000..4a84da0a93e --- /dev/null +++ b/compiler/testData/ir/irText/types/genericDelegatedDeepProperty.txt @@ -0,0 +1,379 @@ +FILE fqName: fileName:/genericDelegatedDeepProperty.kt + CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Value.Value, IT of .Value> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:IT index:1 variance: superTypes:[.IR.Value>] + CONSTRUCTOR visibility:public <> (value1:T of .Value, value2:IT of .Value) returnType:.Value.Value, IT of .Value> [primary] + VALUE_PARAMETER name:value1 index:0 type:T of .Value + VALUE_PARAMETER name:value2 index:1 type:IT of .Value + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Value modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:value1 visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private + EXPRESSION_BODY + GET_VAR 'value1: T of .Value declared in .Value.' type=T of .Value origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value.Value, IT of .Value>) returnType:T of .Value + correspondingProperty: PROPERTY name:value1 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value.Value, IT of .Value> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): T of .Value declared in .Value' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private' type=T of .Value origin=null + receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value.Value, IT of .Value>, :T of .Value) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:value1 visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Value.Value, IT of .Value> + VALUE_PARAMETER name: index:0 type:T of .Value + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value1 type:T of .Value visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> origin=null + value: GET_VAR ': T of .Value declared in .Value.' type=T of .Value origin=null + PROPERTY name:value2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:value2 type:IT of .Value visibility:private [final] + EXPRESSION_BODY + GET_VAR 'value2: IT of .Value declared in .Value.' type=IT of .Value origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Value.Value, IT of .Value>) returnType:IT of .Value + correspondingProperty: PROPERTY name:value2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Value.Value, IT of .Value> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): IT of .Value declared in .Value' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:IT of .Value visibility:private [final]' type=IT of .Value origin=null + receiver: GET_VAR ': .Value.Value, IT of .Value> declared in .Value.' type=.Value.Value, IT of .Value> 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 [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:IDelegate1 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> + TYPE_PARAMETER name:T1 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:R1 index:1 variance: superTypes:[kotlin.Any?] + FUN name:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate1.IDelegate1, R1 of .IDelegate1>, t:T1 of .IDelegate1, p:kotlin.reflect.KProperty<*>) returnType:R1 of .IDelegate1 [operator] + $this: VALUE_PARAMETER name: type:.IDelegate1.IDelegate1, R1 of .IDelegate1> + VALUE_PARAMETER name:t index:0 type:T1 of .IDelegate1 + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + 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:IDelegate2 modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> + TYPE_PARAMETER name:T2 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:R2 index:1 variance: superTypes:[kotlin.Any?] + FUN name:getValue visibility:public modality:ABSTRACT <> ($this:.IDelegate2.IDelegate2, R2 of .IDelegate2>, t:T2 of .IDelegate2, p:kotlin.reflect.KProperty<*>) returnType:R2 of .IDelegate2 [operator] + $this: VALUE_PARAMETER name: type:.IDelegate2.IDelegate2, R2 of .IDelegate2> + VALUE_PARAMETER name:t index:0 type:T2 of .IDelegate2 + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + 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:IR modality:ABSTRACT visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IR.IR> + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] + FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IR.IR>) returnType:R of .IR + $this: VALUE_PARAMETER name: type:.IR.IR> + 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 CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CR.CR> + TYPE_PARAMETER name:R index:0 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (r:R of .CR) returnType:.CR.CR> [primary] + VALUE_PARAMETER name:r index:0 type:R of .CR + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CR modality:FINAL visibility:public superTypes:[.IR.CR>]' + PROPERTY name:r visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final] + EXPRESSION_BODY + GET_VAR 'r: R of .CR declared in .CR.' type=R of .CR origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.CR.CR>) returnType:R of .CR + correspondingProperty: PROPERTY name:r visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): R of .CR declared in .CR' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:r type:R of .CR visibility:private [final]' type=R of .CR origin=null + receiver: GET_VAR ': .CR.CR> declared in .CR.' type=.CR.CR> origin=null + FUN name:foo visibility:public modality:OPEN <> ($this:.CR.CR>) returnType:R of .CR + overridden: + public abstract fun foo (): R of .IR declared in .IR + $this: VALUE_PARAMETER name: type:.CR.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun foo (): R of .CR declared in .CR' + CALL 'public final fun (): R of .CR declared in .CR' type=R of .CR origin=GET_PROPERTY + $this: GET_VAR ': .CR.CR> declared in .CR.foo' type=.CR.CR> 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 .IR + $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 .IR + $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 .IR + $this: VALUE_PARAMETER name: type:kotlin.Any + CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.P.P, P2 of .P> + TYPE_PARAMETER name:P1 index:0 variance: superTypes:[kotlin.Any?] + TYPE_PARAMETER name:P2 index:1 variance: superTypes:[kotlin.Any?] + CONSTRUCTOR visibility:public <> (p1:P1 of .P, p2:P2 of .P) returnType:.P.P, P2 of .P> [primary] + VALUE_PARAMETER name:p1 index:0 type:P1 of .P + VALUE_PARAMETER name:p2 index:1 type:P2 of .P + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:P modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:p1 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p1: P1 of .P declared in .P.' type=P1 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P1 of .P + correspondingProperty: PROPERTY name:p1 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P1 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p1 type:P1 of .P visibility:private [final]' type=P1 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> origin=null + PROPERTY name:p2 visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final] + EXPRESSION_BODY + GET_VAR 'p2: P2 of .P declared in .P.' type=P2 of .P origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.P.P, P2 of .P>) returnType:P2 of .P + correspondingProperty: PROPERTY name:p2 visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.P.P, P2 of .P> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): P2 of .P declared in .P' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p2 type:P2 of .P visibility:private [final]' type=P2 of .P origin=null + receiver: GET_VAR ': .P.P, P2 of .P> declared in .P.' type=.P.P, P2 of .P> 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 [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 + PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate. + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, .P>]' + FUN name:qux11 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F11T of .additionalText$delegate..qux11) returnType:F11T of .additionalText$delegate..qux11 + TYPE_PARAMETER name:F11T index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:F11T of .additionalText$delegate..qux11 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux11 (t: F11T of .additionalText$delegate..qux11): F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate.' + GET_VAR 't: F11T of .additionalText$delegate..qux11 declared in .additionalText$delegate..qux11' type=F11T of .additionalText$delegate..qux11 origin=null + FUN name:qux12 visibility:public modality:FINAL ($this:.additionalText$delegate., t:F12T of .additionalText$delegate..qux12) returnType:kotlin.Any? + TYPE_PARAMETER name:F12T index:0 variance: superTypes:[.IR] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:F12T of .additionalText$delegate..qux12 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux12 (t: F12T of .additionalText$delegate..qux12): kotlin.Any? declared in .additionalText$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null + $this: GET_VAR 't: F12T of .additionalText$delegate..qux12 declared in .additionalText$delegate..qux12' type=F12T of .additionalText$delegate..qux12 origin=null + PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepO$delegate. + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepO$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>]' + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepO$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 [operator] declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? [operator] declared in .additionalText$delegate..deepO$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public final fun (): T of .Value declared in .Value' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepO$delegate..getValue' type=.Value.CR> origin=null + FUN name:qux21 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F21T of .additionalText$delegate..deepO$delegate..qux21) returnType:F21T of .additionalText$delegate..deepO$delegate..qux21 + TYPE_PARAMETER name:F21T index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:F21T of .additionalText$delegate..deepO$delegate..qux21 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux21 (t: F21T of .additionalText$delegate..deepO$delegate..qux21): F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate.' + GET_VAR 't: F21T of .additionalText$delegate..deepO$delegate..qux21 declared in .additionalText$delegate..deepO$delegate..qux21' type=F21T of .additionalText$delegate..deepO$delegate..qux21 origin=null + FUN name:qux22 visibility:public modality:FINAL ($this:.additionalText$delegate..deepO$delegate., t:F22T of .additionalText$delegate..deepO$delegate..qux22) returnType:kotlin.Any? + TYPE_PARAMETER name:F22T index:0 variance: superTypes:[.IR] + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepO$delegate. + VALUE_PARAMETER name:t index:0 type:F22T of .additionalText$delegate..deepO$delegate..qux22 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun qux22 (t: F22T of .additionalText$delegate..deepO$delegate..qux22): kotlin.Any? declared in .additionalText$delegate..deepO$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public abstract fun foo (): R of .IR declared in .IR' type=kotlin.Any? origin=null + $this: GET_VAR 't: F22T of .additionalText$delegate..deepO$delegate..qux22 declared in .additionalText$delegate..deepO$delegate..qux22' type=F22T of .additionalText$delegate..deepO$delegate..qux22 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 .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .additionalText$delegate..deepO$delegate.' type=.additionalText$delegate..deepO$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value.CR>) returnType:kotlin.Any? + correspondingProperty: PROPERTY name:deepO visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + $receiver: VALUE_PARAMETER name: type:.Value.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? [operator] declared in .additionalText$delegate..deepO$delegate.' type=kotlin.Any? origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepO$delegate type:.additionalText$delegate..deepO$delegate. visibility:private [final]' type=.additionalText$delegate..deepO$delegate. origin=null + receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null + t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null + p: PROPERTY_REFERENCE 'private final deepO: kotlin.Any? [delegated,val]' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, .additionalText$delegate., kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final] + EXPRESSION_BODY + BLOCK type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL + CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.additionalText$delegate..deepK$delegate. + CONSTRUCTOR visibility:public <> () returnType:.additionalText$delegate..deepK$delegate. [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.IDelegate1<.Value.CR>, kotlin.Any?>]' + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate..deepK$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:kotlin.Any? [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 [operator] declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate..deepK$delegate. + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? [operator] declared in .additionalText$delegate..deepK$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public open fun foo (): R of .CR declared in .CR' type=kotlin.Any? origin=null + $this: CALL 'public final fun (): IT of .Value declared in .Value' type=.CR origin=GET_PROPERTY + $this: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..deepK$delegate..getValue' type=.Value.CR> 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 .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .additionalText$delegate..deepK$delegate.' type=.additionalText$delegate..deepK$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.additionalText$delegate., $receiver:.Value.CR>) returnType:kotlin.Any? + correspondingProperty: PROPERTY name:deepK visibility:private modality:FINAL [delegated,val] + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + $receiver: VALUE_PARAMETER name: type:.Value.CR> + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): kotlin.Any? declared in .additionalText$delegate.' + TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): kotlin.Any? [operator] declared in .additionalText$delegate..deepK$delegate.' type=kotlin.Any? origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:deepK$delegate type:.additionalText$delegate..deepK$delegate. visibility:private [final]' type=.additionalText$delegate..deepK$delegate. origin=null + receiver: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..' type=.additionalText$delegate. origin=null + t: GET_VAR ': .Value.CR> declared in .additionalText$delegate..' type=.Value.CR> origin=null + p: PROPERTY_REFERENCE 'private final deepK: kotlin.Any? [delegated,val]' field=null getter='private final fun (): kotlin.Any? declared in .additionalText$delegate.' setter=null type=kotlin.reflect.KProperty2<.Value.CR>, .additionalText$delegate., kotlin.Any?> origin=PROPERTY_REFERENCE_FOR_DELEGATE + FUN name:getValue visibility:public modality:OPEN <> ($this:.additionalText$delegate., t:.Value.CR>, p:kotlin.reflect.KProperty<*>) returnType:.P [operator] + overridden: + public abstract fun getValue (t: T1 of .IDelegate1, p: kotlin.reflect.KProperty<*>): R1 of .IDelegate1 [operator] declared in .IDelegate1 + $this: VALUE_PARAMETER name: type:.additionalText$delegate. + VALUE_PARAMETER name:t index:0 type:.Value.CR> + VALUE_PARAMETER name:p index:1 type:kotlin.reflect.KProperty<*> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P [operator] declared in .additionalText$delegate.' + CONSTRUCTOR_CALL 'public constructor (p1: P1 of .P, p2: P2 of .P) [primary] declared in .P' type=.P origin=null + : kotlin.Any? + : kotlin.Any? + p1: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..getValue' type=.additionalText$delegate. origin=null + $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> origin=null + p2: TYPE_OP type=kotlin.Any? origin=IMPLICIT_CAST typeOperand=kotlin.Any? + CALL 'private final fun (): kotlin.Any? declared in .additionalText$delegate.' type=kotlin.Any? origin=GET_PROPERTY + $this: GET_VAR ': .additionalText$delegate. declared in .additionalText$delegate..getValue' type=.additionalText$delegate. origin=null + $receiver: GET_VAR 't: .Value.CR> declared in .additionalText$delegate..getValue' type=.Value.CR> 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 .IDelegate1 + $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 .IDelegate1 + $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 .IDelegate1 + $this: VALUE_PARAMETER name: type:kotlin.Any + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .additionalText$delegate.' type=.additionalText$delegate. origin=OBJECT_LITERAL + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.Value., .CR.>>) returnType:.P., T of .> + correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $receiver: VALUE_PARAMETER name: type:.Value., .CR.>> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .P., T of .> declared in ' + CALL 'public open fun getValue (t: .Value.CR>, p: kotlin.reflect.KProperty<*>): .P [operator] declared in .additionalText$delegate.' type=.P., T of .> origin=null + $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.additionalText$delegate. visibility:private [final,static]' type=.additionalText$delegate. origin=null + t: GET_VAR ': .Value., .CR.>> declared in .' type=.Value., .CR.>> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: .P., T of .> [delegated,val]' field=null getter='public final fun (): .P., T of .> declared in ' setter=null type=kotlin.reflect.KProperty1<.Value., .CR.>>, .P., T of .>> origin=PROPERTY_REFERENCE_FOR_DELEGATE diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index a394dfa9eaa..33a6934b0a5 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -14893,6 +14893,11 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir/serializationRegressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("deepGenericDelegatedProperty.kt") + public void testDeepGenericDelegatedProperty() throws Exception { + runTest("compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt"); + } + @TestMetadata("dispatchReceiverValue.kt") public void testDispatchReceiverValue() throws Exception { runTest("compiler/testData/codegen/box/ir/serializationRegressions/dispatchReceiverValue.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index 59e42e6dc3b..c539547b9d8 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -14898,6 +14898,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir/serializationRegressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); } + @TestMetadata("deepGenericDelegatedProperty.kt") + public void testDeepGenericDelegatedProperty() throws Exception { + runTest("compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt"); + } + @TestMetadata("dispatchReceiverValue.kt") public void testDispatchReceiverValue() throws Exception { runTest("compiler/testData/codegen/box/ir/serializationRegressions/dispatchReceiverValue.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java index ba22a7fac26..021e2660207 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/codegen/ir/IrBlackBoxCodegenTestGenerated.java @@ -13748,6 +13748,11 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir/serializationRegressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true); } + @TestMetadata("deepGenericDelegatedProperty.kt") + public void testDeepGenericDelegatedProperty() throws Exception { + runTest("compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt"); + } + @TestMetadata("dispatchReceiverValue.kt") public void testDispatchReceiverValue() throws Exception { runTest("compiler/testData/codegen/box/ir/serializationRegressions/dispatchReceiverValue.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java index ac2c3c568af..3b8e9b7b079 100644 --- a/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/ir/IrTextTestCaseGenerated.java @@ -1876,6 +1876,11 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase { runTest("compiler/testData/ir/irText/types/genericFunWithStar.kt"); } + @TestMetadata("genericDelegatedDeepProperty.kt") + public void testGenericDelegatedDeepProperty() throws Exception { + runTest("compiler/testData/ir/irText/types/genericDelegatedDeepProperty.kt"); + } + @TestMetadata("genericPropertyReferenceType.kt") public void testGenericPropertyReferenceType() throws Exception { runTest("compiler/testData/ir/irText/types/genericPropertyReferenceType.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 6be7d7f1732..173e3c9d6b6 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -11908,6 +11908,11 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir/serializationRegressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); } + @TestMetadata("deepGenericDelegatedProperty.kt") + public void testDeepGenericDelegatedProperty() throws Exception { + runTest("compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt"); + } + @TestMetadata("dispatchReceiverValue.kt") public void testDispatchReceiverValue() throws Exception { runTest("compiler/testData/codegen/box/ir/serializationRegressions/dispatchReceiverValue.kt"); diff --git a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index 0fc9f468107..9bd04ef0ce4 100644 --- a/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/test/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -11973,6 +11973,11 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { KotlinTestUtils.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/ir/serializationRegressions"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); } + @TestMetadata("deepGenericDelegatedProperty.kt") + public void testDeepGenericDelegatedProperty() throws Exception { + runTest("compiler/testData/codegen/box/ir/serializationRegressions/deepGenericDelegatedProperty.kt"); + } + @TestMetadata("dispatchReceiverValue.kt") public void testDispatchReceiverValue() throws Exception { runTest("compiler/testData/codegen/box/ir/serializationRegressions/dispatchReceiverValue.kt");