From 20cb075e563836eb7e0bdaa3b6c8041110b8432c Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 8 Sep 2023 10:39:22 +0200 Subject: [PATCH] K2: fix calculating property reference type in delegated setter This commit is an accidentally forgotten part of the KT-61045 fix #KT-61720 Fixed --- .../FirLightTreeJvmIrTextTestGenerated.java | 6 + .../ir/FirPsiJvmIrTextTestGenerated.java | 6 + .../FirDeclarationsResolveTransformer.kt | 4 +- ...ropertyAccessorsWithAnnotations.fir.ir.txt | 132 ----------- ...ropertyAccessorsWithAnnotations.fir.kt.txt | 52 ----- ...legatedPropertyAccessorsWithAnnotations.kt | 1 + .../classLevelProperties.fir.ir.txt | 158 ------------- .../classLevelProperties.fir.kt.txt | 56 ----- .../declarations/classLevelProperties.kt | 1 + .../delegatedPropertiesOperators.fir.ir.txt | 2 +- .../delegatedProperties.fir.ir.txt | 129 ----------- .../delegatedProperties.fir.kt.txt | 48 ---- .../declarations/delegatedProperties.kt | 1 + .../genericDelegatedProperty.fir.ir.txt | 81 ------- .../genericDelegatedProperty.fir.kt.txt | 33 --- .../declarations/genericDelegatedProperty.kt | 1 + .../localDelegatedProperties.fir.ir.txt | 2 +- .../packageLevelProperties.fir.ir.txt | 116 ---------- .../packageLevelProperties.fir.kt.txt | 47 ---- .../declarations/packageLevelProperties.kt | 1 + .../provideDelegate/javaDelegate.fir.ir.txt | 4 +- .../expressions/propertyReferences.fir.ir.txt | 2 +- .../delegatedSetterShouldBeSpecialized.ir.txt | 63 ++++++ .../delegatedSetterShouldBeSpecialized.kt | 9 + .../delegatedSetterShouldBeSpecialized.kt.txt | 22 ++ .../firProblems/readWriteProperty.fir.ir.txt | 213 ------------------ .../firProblems/readWriteProperty.fir.kt.txt | 76 ------- .../irText/firProblems/readWriteProperty.kt | 1 + .../ir/ClassicJvmIrTextTestGenerated.java | 6 + .../klib/KlibIrTextTestCaseGenerated.java | 5 + .../FirLightTreeJsIrTextTestGenerated.java | 6 + .../test/fir/FirPsiJsIrTextTestGenerated.java | 6 + .../test/ir/ClassicJsIrTextTestGenerated.java | 6 + .../ClassicNativeIrTextTestGenerated.java | 6 + 34 files changed, 155 insertions(+), 1147 deletions(-) delete mode 100644 compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt create mode 100644 compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt create mode 100644 compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt create mode 100644 compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt delete mode 100644 compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java index 2a03e2eb309..253681e4aa7 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirLightTreeJvmIrTextTestGenerated.java @@ -2664,6 +2664,12 @@ public class FirLightTreeJvmIrTextTestGenerated extends AbstractFirLightTreeJvmI runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @Test @TestMetadata("DelegationAndInheritanceFromJava.kt") public void testDelegationAndInheritanceFromJava() throws Exception { diff --git a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java index 112bfbd781a..c2db7c5305c 100644 --- a/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java +++ b/compiler/fir/fir2ir/tests-gen/org/jetbrains/kotlin/test/runners/ir/FirPsiJvmIrTextTestGenerated.java @@ -2664,6 +2664,12 @@ public class FirPsiJvmIrTextTestGenerated extends AbstractFirPsiJvmIrTextTest { runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @Test @TestMetadata("DelegationAndInheritanceFromJava.kt") public void testDelegationAndInheritanceFromJava() throws Exception { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt index a65f658d6c4..9d19cd4b852 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirDeclarationsResolveTransformer.kt @@ -265,7 +265,9 @@ open class FirDeclarationsResolveTransformer( (property.getter?.body?.statements?.singleOrNull() as? FirReturnExpression)?.let { returnExpression -> (returnExpression.result as? FirFunctionCall)?.replacePropertyReferenceTypeInDelegateAccessors(property) } - (property.setter?.body?.statements?.singleOrNull() as? FirFunctionCall)?.replacePropertyReferenceTypeInDelegateAccessors(property) + (property.setter?.body?.statements?.singleOrNull() as? FirReturnExpression)?.let { returnExpression -> + (returnExpression.result as? FirFunctionCall)?.replacePropertyReferenceTypeInDelegateAccessors(property) + } (property.delegate as? FirFunctionCall)?.replacePropertyReferenceTypeInDelegateAccessors(property) } diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt deleted file mode 100644 index efeb5b2d5bb..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt - CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.A [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.String declared in .A.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .A declared in .A.' type=.A origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation - $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.Annotation - $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.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.Cell [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private - EXPRESSION_BODY - GET_VAR 'value: kotlin.Int declared in .Cell.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.Int - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Cell' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Cell - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Cell declared in .Cell.' type=.Cell origin=null - value: GET_VAR ': kotlin.Int declared in .Cell.' type=kotlin.Int origin=null - FUN name:getValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.Cell - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' - CALL 'public final fun (): kotlin.Int declared in .Cell' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR ': .Cell declared in .Cell.getValue' type=.Cell origin=null - FUN name:setValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Cell - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - VALUE_PARAMETER name:newValue index:2 type:kotlin.Int - BLOCK_BODY - CALL 'public final fun (: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=EQ - $this: GET_VAR ': .Cell declared in .Cell.setValue' type=.Cell origin=null - : GET_VAR 'newValue: kotlin.Int declared in .Cell.setValue' type=kotlin.Int origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:test1$delegate type:.Cell visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) declared in .Cell' type=.Cell origin=null - value: CONST Int type=kotlin.Int value=1 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - annotations: - A(x = 'test1.get') - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor (value: kotlin.Int) declared in .Cell' type=.Cell origin=null - value: CONST Int type=kotlin.Int value=2 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - annotations: - A(x = 'test2.get') - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - annotations: - A(x = 'test2.set') - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] - VALUE_PARAMETER name: index:0 type:kotlin.Int - annotations: - A(x = 'test2.set.param') - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in ' - CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE - newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt deleted file mode 100644 index 2a9511c3c79..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.kt.txt +++ /dev/null @@ -1,52 +0,0 @@ -open annotation class A : Annotation { - constructor(x: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: String - field = x - get - -} - -class Cell { - constructor(value: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - var value: Int - field = value - get - set - - operator fun getValue(thisRef: Any?, kProp: Any?): Int { - return .() - } - - operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int) { - .( = newValue) - } - -} - -val test1: Int /* by */ - field = Cell(value = 1) - @A(x = "test1.get") - get(): Int { - return #test1$delegate.getValue(thisRef = null, kProp = ::test1) - } - -var test2: Int /* by */ - field = Cell(value = 2) - @A(x = "test2.get") - get(): Int { - return #test2$delegate.getValue(thisRef = null, kProp = ::test2) - } - @A(x = "test2.set") - set(@A(x = "test2.set.param") : Int) { - return #test2$delegate.setValue(thisRef = null, kProp = ::test2, newValue = ) - } diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt index dfafc186680..110c878e936 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL annotation class A(val x: String) class Cell(var value: Int) { diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt deleted file mode 100644 index d3ce4716418..00000000000 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.ir.txt +++ /dev/null @@ -1,158 +0,0 @@ -FILE fqName: fileName:/classLevelProperties.kt - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CONST Int type=kotlin.Int value=0 - PROPERTY name:test3 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - PROPERTY name:test4 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN name: visibility:public modality:FINAL <> ($this:.C, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private' type=kotlin.Unit origin=EQ - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR 'value: kotlin.Int declared in .C.' type=kotlin.Int origin=null - PROPERTY name:test5 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - PROPERTY name:test6 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy origin=null - : kotlin.Int - initializer: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .C.test7$delegate' - CONST Int type=kotlin.Int value=42 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlin.Int origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null - : kotlin.String - : kotlin.Int - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V1 of kotlin.collections.getValue declared in kotlin.collections' type=kotlin.Int origin=null - : kotlin.Int - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' type=java.util.HashMap origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in .C' - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' type=java.util.HashMap origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .C' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt deleted file mode 100644 index 7febedbcc3e..00000000000 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.kt.txt +++ /dev/null @@ -1,56 +0,0 @@ -class C { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - val test1: Int - field = 0 - get - - val test2: Int - get(): Int { - return 0 - } - - var test3: Int - field = 0 - get - set - - var test4: Int - field = 1 - get - set(value: Int) { - .#test4 = value - } - - var test5: Int - field = 1 - get - private set - - val test6: Int - field = 1 - get - - val test7: Int /* by */ - field = lazy(initializer = local fun (): Int { - return 42 - } -) - get(): Int { - return .#test7$delegate.getValue(thisRef = , property = C::test7) - } - - var test8: Int /* by */ - field = hashMapOf() - get(): Int { - return .#test8$delegate.getValue(thisRef = , property = C::test8) - } - set(: Int) { - return .#test8$delegate.setValue(thisRef = , property = C::test8, value = ) - } - -} diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.kt b/compiler/testData/ir/irText/declarations/classLevelProperties.kt index 6c89c320ac5..d18d3d07b8f 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.kt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 diff --git a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt index 94b5bc67b8c..0a2df27bb8f 100644 --- a/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/contextReceivers/delegatedPropertiesOperators.fir.ir.txt @@ -120,7 +120,7 @@ FILE fqName: fileName:/delegatedPropertiesOperators.kt $context_receiver_0: GET_FIELD 'FIELD FIELD_FOR_CLASS_CONTEXT_RECEIVER name:contextReceiverField0 type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .Result declared in .Result.' type=.Result origin=null thisRef: GET_VAR ': .Result declared in .Result.' type=.Result origin=null - property: PROPERTY_REFERENCE 'public final s: kotlin.String' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final s: kotlin.String' field=null getter='public final fun (): kotlin.String declared in .Result' setter='public final fun (: kotlin.String): kotlin.Unit declared in .Result' type=kotlin.reflect.KMutableProperty1<.Result, kotlin.String> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.String declared in .Result.' type=kotlin.String origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt deleted file mode 100644 index 61afb73e2d9..00000000000 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.ir.txt +++ /dev/null @@ -1,129 +0,0 @@ -FILE fqName: fileName:/delegatedProperties.kt - PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy origin=null - : kotlin.Int - initializer: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test1$delegate' - CONST Int type=kotlin.Int value=42 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [delegated,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlin.Int origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test1: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (map:kotlin.collections.MutableMap) returnType:.C [primary] - VALUE_PARAMETER name:map index:0 type:kotlin.collections.MutableMap - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:map visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap visibility:private [final] - EXPRESSION_BODY - GET_VAR 'map: kotlin.collections.MutableMap declared in .C.' type=kotlin.collections.MutableMap origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.collections.MutableMap - correspondingProperty: PROPERTY name:map visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.MutableMap declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.MutableMap visibility:private [final]' type=kotlin.collections.MutableMap origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - PROPERTY name:test2 visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy origin=null - : kotlin.Int - initializer: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .C.test2$delegate' - CONST Int type=kotlin.Int value=42 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlin.Int origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test2: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty1<.C, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun (): kotlin.collections.MutableMap declared in .C' type=kotlin.collections.MutableMap origin=GET_PROPERTY - $this: GET_VAR ': .C declared in .C' type=.C origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Any - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in .C' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V1 of kotlin.collections.getValue declared in kotlin.collections' type=kotlin.Any origin=null - : kotlin.Any - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' type=kotlin.collections.MutableMap origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test3: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<.C, kotlin.Any> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :kotlin.Any) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name: index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Any): kotlin.Unit declared in .C' - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' type=kotlin.collections.MutableMap origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - thisRef: GET_VAR ': .C declared in .C.' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test3: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in .C' setter='public final fun (: kotlin.Any): kotlin.Unit declared in .C' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Any declared in .C.' type=kotlin.Any origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null - : kotlin.String - : kotlin.Any - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Any - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V1 of kotlin.collections.getValue declared in kotlin.collections' type=kotlin.Any origin=null - : kotlin.Any - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Any) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] - VALUE_PARAMETER name: index:0 type:kotlin.Any - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Any): kotlin.Unit declared in ' - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Any - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test4: kotlin.Any' field=null getter='public final fun (): kotlin.Any declared in ' setter='public final fun (: kotlin.Any): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Any declared in .' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt deleted file mode 100644 index 59dff52a6ac..00000000000 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.kt.txt +++ /dev/null @@ -1,48 +0,0 @@ -val test1: Int /* by */ - field = lazy(initializer = local fun (): Int { - return 42 - } -) - get(): Int { - return #test1$delegate.getValue(thisRef = null, property = ::test1) - } - -class C { - constructor(map: MutableMap) /* primary */ { - super/*Any*/() - /* () */ - - } - - val map: MutableMap - field = map - get - - val test2: Int /* by */ - field = lazy(initializer = local fun (): Int { - return 42 - } -) - get(): Int { - return .#test2$delegate.getValue(thisRef = , property = C::test2) - } - - var test3: Any /* by */ - field = .() - get(): Any { - return .#test3$delegate.getValue(thisRef = , property = C::test3) - } - set(: Any) { - return .#test3$delegate.setValue(thisRef = , property = C::test3, value = ) - } - -} - -var test4: Any /* by */ - field = hashMapOf() - get(): Any { - return #test4$delegate.getValue(thisRef = null, property = ::test4) - } - set(: Any) { - return #test4$delegate.setValue(thisRef = null, property = ::test4, value = ) - } diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.kt b/compiler/testData/ir/irText/declarations/delegatedProperties.kt index 589399a7cf4..21c4b735439 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.kt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt deleted file mode 100644 index 320dca7e25a..00000000000 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.ir.txt +++ /dev/null @@ -1,81 +0,0 @@ -FILE fqName: fileName:/genericDelegatedProperty.kt - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C.C> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.C.C> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegate - CONSTRUCTOR visibility:private <> () returnType:.Delegate [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN name:getValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any?) returnType:kotlin.Int [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Delegate' - CONST Int type=kotlin.Int value=42 - FUN name:setValue visibility:public modality:FINAL <> ($this:.Delegate, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit [operator] - $this: VALUE_PARAMETER name: type:.Delegate - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:kProp index:1 type:kotlin.Any? - VALUE_PARAMETER name:newValue index:2 type:kotlin.Int - BLOCK_BODY - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:genericDelegatedProperty visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:genericDelegatedProperty$delegate type:.Delegate visibility:private [final,static] - EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:Delegate modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Delegate - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.C.>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:genericDelegatedProperty visibility:public modality:FINAL [delegated,var] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.C.> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:genericDelegatedProperty$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null - thisRef: GET_VAR ': .C.> declared in .' type=.C.> origin=null - kProp: PROPERTY_REFERENCE 'public final genericDelegatedProperty: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1<.C.>, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL ($receiver:.C.>, :kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:genericDelegatedProperty visibility:public modality:FINAL [delegated,var] - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - $receiver: VALUE_PARAMETER name: type:.C.> - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in ' - CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:genericDelegatedProperty$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null - thisRef: GET_VAR ': .C.> declared in .' type=.C.> origin=null - kProp: PROPERTY_REFERENCE 'public final genericDelegatedProperty: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE - <1>: T of . - newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt deleted file mode 100644 index 27b6bfe00a3..00000000000 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.fir.kt.txt +++ /dev/null @@ -1,33 +0,0 @@ -class C { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -object Delegate { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - operator fun getValue(thisRef: Any?, kProp: Any?): Int { - return 42 - } - - operator fun setValue(thisRef: Any?, kProp: Any?, newValue: Int) { - } - -} - -var C.genericDelegatedProperty: Int /* by */ - field = Delegate - get(): Int { - return #genericDelegatedProperty$delegate.getValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/) - } - set(: Int) { - return #genericDelegatedProperty$delegate.setValue(thisRef = , kProp = ::genericDelegatedProperty/*()*/, newValue = ) - } diff --git a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt index 56a4f789fee..ba4976e9ce7 100644 --- a/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt +++ b/compiler/testData/ir/irText/declarations/genericDelegatedProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class C object Delegate { diff --git a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt index b6fb0cffa90..3d5f8ee1703 100644 --- a/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/localDelegatedProperties.fir.ir.txt @@ -44,7 +44,7 @@ FILE fqName: fileName:/localDelegatedProperties.kt : kotlin.Int $receiver: GET_VAR 'val x$delegate: java.util.HashMap declared in .test2' type=java.util.HashMap origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'var x: kotlin.Int by (...)' delegate='val x$delegate: java.util.HashMap declared in .test2' getter='local final fun (): kotlin.Int declared in .test2' setter='local final fun (: kotlin.Int): kotlin.Unit declared in .test2' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: LOCAL_DELEGATED_PROPERTY_REFERENCE 'var x: kotlin.Int by (...)' delegate='val x$delegate: java.util.HashMap declared in .test2' getter='local final fun (): kotlin.Int declared in .test2' setter='local final fun (: kotlin.Int): kotlin.Unit declared in .test2' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .test2.' type=kotlin.Int origin=null CALL 'local final fun (: kotlin.Int): kotlin.Unit declared in .test2' type=kotlin.Unit origin=EQ : CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt deleted file mode 100644 index c867f735344..00000000000 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.ir.txt +++ /dev/null @@ -1,116 +0,0 @@ -FILE fqName: fileName:/packageLevelProperties.kt - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=0 - PROPERTY name:test3 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - PROPERTY name:test4 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=EQ - value: GET_VAR 'value: kotlin.Int declared in .' type=kotlin.Int origin=null - PROPERTY name:test5 visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private [static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [var] - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null - PROPERTY name:test6 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:private [final,static] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=1 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Int visibility:private [final,static]' type=kotlin.Int origin=null - PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] - FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy origin=null - : kotlin.Int - initializer: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test7$delegate' - CONST Int type=kotlin.Int value=42 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [delegated,val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of kotlin.getValue declared in kotlin' type=kotlin.Int origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static] - EXPRESSION_BODY - CALL 'public final fun hashMapOf (): java.util.HashMap declared in kotlin.collections' type=java.util.HashMap origin=null - : kotlin.String - : kotlin.Int - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V1 of kotlin.collections.getValue declared in kotlin.collections' type=kotlin.Int origin=null - : kotlin.Int - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] - VALUE_PARAMETER name: index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in ' - CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.collections.setValue): kotlin.Unit declared in kotlin.collections' type=kotlin.Unit origin=null - : kotlin.Int - $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' type=java.util.HashMap origin=null - thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test8: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt deleted file mode 100644 index 5db7671b429..00000000000 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.kt.txt +++ /dev/null @@ -1,47 +0,0 @@ -val test1: Int - field = 0 - get - -val test2: Int - get(): Int { - return 0 - } - -var test3: Int - field = 0 - get - set - -var test4: Int - field = 1 - get - set(value: Int) { - #test4 = value - } - -var test5: Int - field = 1 - get - private set - -val test6: Int - field = 1 - get - -val test7: Int /* by */ - field = lazy(initializer = local fun (): Int { - return 42 - } -) - get(): Int { - return #test7$delegate.getValue(thisRef = null, property = ::test7) - } - -var test8: Int /* by */ - field = hashMapOf() - get(): Int { - return #test8$delegate.getValue(thisRef = null, property = ::test8) - } - set(: Int) { - return #test8$delegate.setValue(thisRef = null, property = ::test8, value = ) - } diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.kt b/compiler/testData/ir/irText/declarations/packageLevelProperties.kt index d2e1df308a8..14e036ca9cb 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.kt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt index afa7f8dc01a..8874e585610 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/javaDelegate.fir.ir.txt @@ -22,7 +22,7 @@ FILE fqName:k fileName:/box.kt : @[FlexibleNullability] kotlin.String? $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:p1$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final p1: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final p1: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': @[FlexibleNullability] kotlin.String? declared in k.' type=@[FlexibleNullability] kotlin.String? origin=null PROPERTY name:p2 visibility:public modality:FINAL [delegated,var] FIELD PROPERTY_DELEGATE name:p2$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static] @@ -47,7 +47,7 @@ FILE fqName:k fileName:/box.kt : @[FlexibleNullability] kotlin.String? $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:p2$delegate type:kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> visibility:private [final,static]' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final p2: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + property: PROPERTY_REFERENCE 'public final p2: @[FlexibleNullability] kotlin.String?' field=null getter='public final fun (): @[FlexibleNullability] kotlin.String? declared in k' setter='public final fun (: @[FlexibleNullability] kotlin.String?): kotlin.Unit declared in k' type=kotlin.reflect.KMutableProperty0<@[FlexibleNullability] kotlin.String?> origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': @[FlexibleNullability] kotlin.String? declared in k.' type=@[FlexibleNullability] kotlin.String? origin=null FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt index bbdd10d8713..26e8db6631e 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.ir.txt @@ -229,7 +229,7 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any, value: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=null thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0<*> origin=PROPERTY_REFERENCE_FOR_DELEGATE + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=PROPERTY_REFERENCE_FOR_DELEGATE value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_delegatedVar type:kotlin.reflect.KMutableProperty0 visibility:private [final,static] diff --git a/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt new file mode 100644 index 00000000000..e726af76573 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.ir.txt @@ -0,0 +1,63 @@ +FILE fqName: fileName:/delegatedSetterShouldBeSpecialized.kt + PROPERTY name:topLevelInt visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:topLevelInt type:kotlin.Int visibility:private [static] + EXPRESSION_BODY + CONST Int type=kotlin.Int value=0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + correspondingProperty: PROPERTY name:topLevelInt visibility:public modality:FINAL [var] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:topLevelInt type:kotlin.Int visibility:private [static]' type=kotlin.Int origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:topLevelInt visibility:public modality:FINAL [var] + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:topLevelInt type:kotlin.Int visibility:private [static]' type=kotlin.Unit origin=null + value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null + CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any] + $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyClass + CONSTRUCTOR visibility:public <> () returnType:.MyClass [primary] + BLOCK_BODY + DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' + INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MyClass modality:FINAL visibility:public superTypes:[kotlin.Any]' + PROPERTY name:delegatedToTopLevel visibility:public modality:FINAL [delegated,var] + FIELD PROPERTY_DELEGATE name:delegatedToTopLevel$delegate type:kotlin.reflect.KMutableProperty0 visibility:private [final] + EXPRESSION_BODY + PROPERTY_REFERENCE 'public final topLevelInt: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyClass) returnType:kotlin.Int + correspondingProperty: PROPERTY name:delegatedToTopLevel visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.MyClass + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .MyClass' + CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V of kotlin.getValue declared in kotlin' type=kotlin.Int origin=null + : kotlin.Int + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:delegatedToTopLevel$delegate type:kotlin.reflect.KMutableProperty0 visibility:private [final]' type=kotlin.reflect.KMutableProperty0 origin=null + receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + thisRef: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + property: PROPERTY_REFERENCE 'public final delegatedToTopLevel: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .MyClass' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .MyClass' type=kotlin.reflect.KMutableProperty1<.MyClass, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyClass, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:delegatedToTopLevel visibility:public modality:FINAL [delegated,var] + $this: VALUE_PARAMETER name: type:.MyClass + VALUE_PARAMETER name: index:0 type:kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int): kotlin.Unit declared in .MyClass' + CALL 'public final fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of kotlin.setValue): kotlin.Unit declared in kotlin' type=kotlin.Unit origin=null + : kotlin.Int + $receiver: GET_FIELD 'FIELD PROPERTY_DELEGATE name:delegatedToTopLevel$delegate type:kotlin.reflect.KMutableProperty0 visibility:private [final]' type=kotlin.reflect.KMutableProperty0 origin=null + receiver: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + thisRef: GET_VAR ': .MyClass declared in .MyClass.' type=.MyClass origin=null + property: PROPERTY_REFERENCE 'public final delegatedToTopLevel: kotlin.Int' field=null getter='public final fun (): kotlin.Int declared in .MyClass' setter='public final fun (: kotlin.Int): kotlin.Unit declared in .MyClass' type=kotlin.reflect.KMutableProperty1<.MyClass, kotlin.Int> origin=PROPERTY_REFERENCE_FOR_DELEGATE + value: GET_VAR ': kotlin.Int declared in .MyClass.' type=kotlin.Int origin=null + FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any + FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt new file mode 100644 index 00000000000..af926d86178 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt @@ -0,0 +1,9 @@ +// FIR_IDENTICAL +// WITH_REFLECT +// SKIP_SIGNATURE_DUMP + +var topLevelInt: Int = 0 + +class MyClass { + var delegatedToTopLevel: Int by ::topLevelInt +} diff --git a/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt new file mode 100644 index 00000000000..3ece1629e89 --- /dev/null +++ b/compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt.txt @@ -0,0 +1,22 @@ +var topLevelInt: Int + field = 0 + get + set + +class MyClass { + constructor() /* primary */ { + super/*Any*/() + /* () */ + + } + + var delegatedToTopLevel: Int /* by */ + field = ::topLevelInt + get(): Int { + return .#delegatedToTopLevel$delegate.getValue(thisRef = , property = MyClass::delegatedToTopLevel) + } + set(: Int) { + return .#delegatedToTopLevel$delegate.setValue(thisRef = , property = MyClass::delegatedToTopLevel, value = ) + } + +} diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt deleted file mode 100644 index c802b814405..00000000000 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.ir.txt +++ /dev/null @@ -1,213 +0,0 @@ -FILE fqName: fileName:/readWriteProperty.kt - CLASS CLASS name:SettingType modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SettingType.SettingType> - TYPE_PARAMETER name:V index:0 variance:out superTypes:[kotlin.Any] reified:false - CONSTRUCTOR visibility:public <> (type:kotlin.reflect.KClass.SettingType>) returnType:.SettingType.SettingType> [primary] - VALUE_PARAMETER name:type index:0 type:kotlin.reflect.KClass.SettingType> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SettingType modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:type visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.reflect.KClass.SettingType> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'type: kotlin.reflect.KClass.SettingType> declared in .SettingType.' type=kotlin.reflect.KClass.SettingType> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.SettingType.SettingType>) returnType:kotlin.reflect.KClass.SettingType> - correspondingProperty: PROPERTY name:type visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.SettingType.SettingType> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.SettingType> declared in .SettingType' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:type type:kotlin.reflect.KClass.SettingType> visibility:private [final]' type=kotlin.reflect.KClass.SettingType> origin=null - receiver: GET_VAR ': .SettingType.SettingType> declared in .SettingType.' type=.SettingType.SettingType> origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:SettingReference modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.SettingReference.SettingReference, T of .SettingReference> - TYPE_PARAMETER name:V index:0 variance: superTypes:[kotlin.Any] reified:false - TYPE_PARAMETER name:T index:1 variance: superTypes:[.SettingType.SettingReference>] reified:false - CONSTRUCTOR visibility:public <> (t:T of .SettingReference, v:V of .SettingReference) returnType:.SettingReference.SettingReference, T of .SettingReference> [primary] - VALUE_PARAMETER name:t index:0 type:T of .SettingReference - VALUE_PARAMETER name:v index:1 type:V of .SettingReference - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:SettingReference modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:t visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:t type:T of .SettingReference visibility:private - EXPRESSION_BODY - GET_VAR 't: T of .SettingReference declared in .SettingReference.' type=T of .SettingReference origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.SettingReference.SettingReference, T of .SettingReference>) returnType:T of .SettingReference - correspondingProperty: PROPERTY name:t visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.SettingReference.SettingReference, T of .SettingReference> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .SettingReference declared in .SettingReference' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:T of .SettingReference visibility:private' type=T of .SettingReference origin=null - receiver: GET_VAR ': .SettingReference.SettingReference, T of .SettingReference> declared in .SettingReference.' type=.SettingReference.SettingReference, T of .SettingReference> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.SettingReference.SettingReference, T of .SettingReference>, :T of .SettingReference) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:t visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.SettingReference.SettingReference, T of .SettingReference> - VALUE_PARAMETER name: index:0 type:T of .SettingReference - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:t type:T of .SettingReference visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .SettingReference.SettingReference, T of .SettingReference> declared in .SettingReference.' type=.SettingReference.SettingReference, T of .SettingReference> origin=null - value: GET_VAR ': T of .SettingReference declared in .SettingReference.' type=T of .SettingReference origin=null - PROPERTY name:v visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:v type:V of .SettingReference visibility:private - EXPRESSION_BODY - GET_VAR 'v: V of .SettingReference declared in .SettingReference.' type=V of .SettingReference origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.SettingReference.SettingReference, T of .SettingReference>) returnType:V of .SettingReference - correspondingProperty: PROPERTY name:v visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.SettingReference.SettingReference, T of .SettingReference> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): V of .SettingReference declared in .SettingReference' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:v type:V of .SettingReference visibility:private' type=V of .SettingReference origin=null - receiver: GET_VAR ': .SettingReference.SettingReference, T of .SettingReference> declared in .SettingReference.' type=.SettingReference.SettingReference, T of .SettingReference> origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.SettingReference.SettingReference, T of .SettingReference>, :V of .SettingReference) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:v visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.SettingReference.SettingReference, T of .SettingReference> - VALUE_PARAMETER name: index:0 type:V of .SettingReference - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:v type:V of .SettingReference visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .SettingReference.SettingReference, T of .SettingReference> declared in .SettingReference.' type=.SettingReference.SettingReference, T of .SettingReference> origin=null - value: GET_VAR ': V of .SettingReference declared in .SettingReference.' type=V of .SettingReference origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:IdeWizard modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdeWizard - CONSTRUCTOR visibility:public <> () returnType:.IdeWizard [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IdeWizard modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] - FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final] - EXPRESSION_BODY - CALL 'private final fun setting (reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting>): .IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard' type=.IdeWizard.setting..SettingType> origin=null - : kotlin.Int - : .SettingType - $this: GET_VAR ': .IdeWizard declared in .IdeWizard' type=.IdeWizard origin=null - reference: CONSTRUCTOR_CALL 'public constructor (t: T of .SettingReference, v: V of .SettingReference) declared in .SettingReference' type=.SettingReference.SettingType> origin=null - : kotlin.Int - : .SettingType - t: CONSTRUCTOR_CALL 'public constructor (type: kotlin.reflect.KClass.SettingType>) declared in .SettingType' type=.SettingType origin=null - : kotlin.Int - type: GET_CLASS type=kotlin.reflect.KClass - CONST Int type=kotlin.Int value=42 - v: CONST Int type=kotlin.Int value=42 - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdeWizard) returnType:kotlin.Int? - correspondingProperty: PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.IdeWizard - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int? declared in .IdeWizard' - CALL 'public open fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V of .IdeWizard.setting? declared in .IdeWizard.setting.' type=kotlin.Int? origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null - receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<.IdeWizard, kotlin.Int?> origin=PROPERTY_REFERENCE_FOR_DELEGATE - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdeWizard, :kotlin.Int?) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:projectTemplate visibility:public modality:FINAL [delegated,var] - $this: VALUE_PARAMETER name: type:.IdeWizard - VALUE_PARAMETER name: index:0 type:kotlin.Int? - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' - CALL 'public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:projectTemplate$delegate type:.IdeWizard.setting..SettingType> visibility:private [final]' type=.IdeWizard.setting..SettingType> origin=null - receiver: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - thisRef: GET_VAR ': .IdeWizard declared in .IdeWizard.' type=.IdeWizard origin=null - property: PROPERTY_REFERENCE 'public final projectTemplate: kotlin.Int?' field=null getter='public final fun (): kotlin.Int? declared in .IdeWizard' setter='public final fun (: kotlin.Int?): kotlin.Unit declared in .IdeWizard' type=kotlin.reflect.KMutableProperty1<*, *> origin=PROPERTY_REFERENCE_FOR_DELEGATE - value: GET_VAR ': kotlin.Int? declared in .IdeWizard.' type=kotlin.Int? origin=null - FUN name:setting visibility:private modality:FINAL ($this:.IdeWizard, reference:.SettingReference.IdeWizard.setting, T of .IdeWizard.setting>) returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - TYPE_PARAMETER name:V index:0 variance: superTypes:[kotlin.Any] reified:false - TYPE_PARAMETER name:T index:1 variance: superTypes:[.SettingType.IdeWizard.setting>] reified:false - $this: VALUE_PARAMETER name: type:.IdeWizard - VALUE_PARAMETER name:reference index:0 type:.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun setting (reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting>): .IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard' - BLOCK type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL - CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.properties.ReadWriteProperty.IdeWizard.setting?>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - CONSTRUCTOR visibility:public <> () returnType:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[kotlin.properties.ReadWriteProperty.IdeWizard.setting?>]' - FUN name:setValue visibility:public modality:OPEN <> ($this:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>, value:V of .IdeWizard.setting?) returnType:kotlin.Unit [operator] - overridden: - public abstract fun setValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>, value: V of kotlin.properties.ReadWriteProperty): kotlin.Unit declared in kotlin.properties.ReadWriteProperty - $this: VALUE_PARAMETER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> - VALUE_PARAMETER name:value index:2 type:V of .IdeWizard.setting? - BLOCK_BODY - WHEN type=kotlin.Unit origin=IF - BRANCH - if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ - arg0: GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null - arg1: CONST Null type=kotlin.Nothing? value=null - then: RETURN type=kotlin.Nothing from='public open fun setValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>, value: V of .IdeWizard.setting?): kotlin.Unit declared in .IdeWizard.setting.' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - CALL 'public final fun (: T of .SettingReference): kotlin.Unit declared in .SettingReference' type=kotlin.Unit origin=EQ - $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null - : TYPE_OP type=T of .IdeWizard.setting origin=CAST typeOperand=T of .IdeWizard.setting - CONSTRUCTOR_CALL 'public constructor (type: kotlin.reflect.KClass.SettingType>) declared in .SettingType' type=.SettingType.IdeWizard.setting> origin=null - : V of .IdeWizard.setting - type: GET_CLASS type=kotlin.reflect.KClass.IdeWizard.setting> - GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null - CALL 'public final fun (: V of .SettingReference): kotlin.Unit declared in .SettingReference' type=kotlin.Unit origin=EQ - $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null - : GET_VAR 'value: V of .IdeWizard.setting? declared in .IdeWizard.setting..setValue' type=V of .IdeWizard.setting? origin=null - FUN name:getValue visibility:public modality:OPEN <> ($this:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting>, thisRef:kotlin.Any?, property:kotlin.reflect.KProperty<*>) returnType:V of .IdeWizard.setting? [operator] - overridden: - public abstract fun getValue (thisRef: T of kotlin.properties.ReadWriteProperty, property: kotlin.reflect.KProperty<*>): V of kotlin.properties.ReadWriteProperty declared in kotlin.properties.ReadWriteProperty - $this: VALUE_PARAMETER name: type:.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> - VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? - VALUE_PARAMETER name:property index:1 type:kotlin.reflect.KProperty<*> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): V of .IdeWizard.setting? declared in .IdeWizard.setting.' - CALL 'public final fun (): V of .SettingReference declared in .SettingReference' type=V of .IdeWizard.setting origin=GET_PROPERTY - $this: GET_VAR 'reference: .SettingReference.IdeWizard.setting, T of .IdeWizard.setting> declared in .IdeWizard.setting' type=.SettingReference.IdeWizard.setting, T of .IdeWizard.setting> origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.properties.ReadWriteProperty - $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.properties.ReadWriteProperty - $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.properties.ReadWriteProperty - $this: VALUE_PARAMETER name: type:kotlin.Any - CONSTRUCTOR_CALL 'public constructor () declared in .IdeWizard.setting.' type=.IdeWizard.setting..IdeWizard.setting, T of .IdeWizard.setting> origin=OBJECT_LITERAL - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt b/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt deleted file mode 100644 index 895e9c43fc1..00000000000 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.fir.kt.txt +++ /dev/null @@ -1,76 +0,0 @@ -class SettingType { - constructor(type: KClass) /* primary */ { - super/*Any*/() - /* () */ - - } - - val type: KClass - field = type - get - -} - -class SettingReference> { - constructor(t: T, v: V) /* primary */ { - super/*Any*/() - /* () */ - - } - - var t: T - field = t - get - set - - var v: V - field = v - get - set - -} - -class IdeWizard { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - var projectTemplate: Int? /* by */ - field = .setting>(reference = SettingReference>(t = SettingType(type = 42::class), v = 42)) - get(): Int? { - return .#projectTemplate$delegate.getValue(thisRef = , property = IdeWizard::projectTemplate) - } - set(: Int?) { - return .#projectTemplate$delegate.setValue(thisRef = , property = IdeWizard::projectTemplate, value = ) - } - - private fun > setting(reference: SettingReference): { - return { // BLOCK - local class : ReadWriteProperty { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override operator fun setValue(thisRef: Any?, property: KProperty<*>, value: V?) { - when { - EQEQ(arg0 = value, arg1 = null) -> return Unit - } - reference.( = SettingType(type = value::class) as T) - reference.( = value) - } - - override operator fun getValue(thisRef: Any?, property: KProperty<*>): V? { - return reference.() - } - - } - - () - } - } - -} diff --git a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt index a8e03387a17..95a47390ace 100644 --- a/compiler/testData/ir/irText/firProblems/readWriteProperty.kt +++ b/compiler/testData/ir/irText/firProblems/readWriteProperty.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // WITH_REFLECT // DUMP_LOCAL_DECLARATION_SIGNATURES diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java index 27dd001b00e..54f9116e2e9 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/ir/ClassicJvmIrTextTestGenerated.java @@ -2664,6 +2664,12 @@ public class ClassicJvmIrTextTestGenerated extends AbstractClassicJvmIrTextTest runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @Test @TestMetadata("DelegationAndInheritanceFromJava.kt") public void testDelegationAndInheritanceFromJava() throws Exception { diff --git a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java index c5f4c993f1f..2b1ec86c80f 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/klib/KlibIrTextTestCaseGenerated.java @@ -2013,6 +2013,11 @@ public class KlibIrTextTestCaseGenerated extends AbstractKlibIrTextTestCase { runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @TestMetadata("deprecated.kt") public void testDeprecated() throws Exception { runTest("compiler/testData/ir/irText/firProblems/deprecated.kt"); diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java index fb8b07b91f9..c6cb2de1f91 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirLightTreeJsIrTextTestGenerated.java @@ -2304,6 +2304,12 @@ public class FirLightTreeJsIrTextTestGenerated extends AbstractFirLightTreeJsIrT runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @Test @TestMetadata("deprecated.kt") public void testDeprecated() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java index 3ebad436a83..61e668f08b9 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/fir/FirPsiJsIrTextTestGenerated.java @@ -2304,6 +2304,12 @@ public class FirPsiJsIrTextTestGenerated extends AbstractFirPsiJsIrTextTest { runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @Test @TestMetadata("deprecated.kt") public void testDeprecated() throws Exception { diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java index f2b91a81257..8bb63c8ed57 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/ClassicJsIrTextTestGenerated.java @@ -2304,6 +2304,12 @@ public class ClassicJsIrTextTestGenerated extends AbstractClassicJsIrTextTest { runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @Test @TestMetadata("deprecated.kt") public void testDeprecated() throws Exception { diff --git a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/irtext/ClassicNativeIrTextTestGenerated.java b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/irtext/ClassicNativeIrTextTestGenerated.java index e8d792b30e9..f07a5bf0c2f 100644 --- a/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/irtext/ClassicNativeIrTextTestGenerated.java +++ b/native/native.tests/tests-gen/org/jetbrains/kotlin/konan/irtext/ClassicNativeIrTextTestGenerated.java @@ -2310,6 +2310,12 @@ public class ClassicNativeIrTextTestGenerated extends AbstractClassicNativeIrTex runTest("compiler/testData/ir/irText/firProblems/DeepCopyIrTree.kt"); } + @Test + @TestMetadata("delegatedSetterShouldBeSpecialized.kt") + public void testDelegatedSetterShouldBeSpecialized() throws Exception { + runTest("compiler/testData/ir/irText/firProblems/delegatedSetterShouldBeSpecialized.kt"); + } + @Test @TestMetadata("deprecated.kt") public void testDeprecated() throws Exception {