From 917e7bffbd1de300b03660e2732b02ae22ab9aea Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Wed, 31 Aug 2016 12:52:36 +0300 Subject: [PATCH] Property accessors are now children of IrProperty. --- .../psi2ir/generators/ClassGenerator.kt | 4 -- .../psi2ir/generators/ModuleGenerator.kt | 8 ---- .../src/org/jetbrains/kotlin/ir/IrSlots.kt | 4 +- .../kotlin/ir/declarations/IrProperty.kt | 40 +++++++++++++------ .../ir/declarations/IrPropertyAccessor.kt | 5 +-- .../kotlin/ir/util/RenderIrElement.kt | 6 +-- ...tReorderingInDelegatingConstructorCall.txt | 4 +- .../ir/irText/classes/classMembers.txt | 36 ++++++++--------- .../ir/irText/classes/dataClasses.txt | 6 +-- .../testData/ir/irText/classes/initVal.txt | 6 +-- .../testData/ir/irText/classes/initVar.txt | 36 ++++++++--------- .../classes/objectLiteralExpressions.txt | 4 +- .../ir/irText/classes/primaryConstructor.txt | 12 +++--- ...aryConstructorWithSuperConstructorCall.txt | 4 +- .../ir/irText/classes/qualifiedSuperCalls.txt | 38 +++++++++--------- ...nstructorWithInitializersFromClassBody.txt | 4 +- .../testData/ir/irText/classes/superCalls.txt | 14 +++---- .../ir/irText/expressions/arrayAccess.txt | 2 +- .../expressions/arrayAugmentedAssignment1.txt | 2 +- .../ir/irText/expressions/assignments.txt | 2 +- .../expressions/augmentedAssignment1.txt | 2 +- .../expressions/augmentedAssignment2.txt | 2 +- .../testData/ir/irText/expressions/elvis.txt | 2 +- .../extensionPropertyGetterCall.txt | 10 ++--- .../testData/ir/irText/expressions/field.txt | 24 +++++------ .../expressions/forWithImplicitReceivers.txt | 2 +- .../irText/expressions/incrementDecrement.txt | 4 +- .../expressions/jvmStaticFieldReference.txt | 32 +++++++-------- .../ir/irText/expressions/literals.txt | 26 ++++++------ .../ir/irText/expressions/references.txt | 24 +++++------ .../safeCallWithIncrementDecrement.txt | 14 +++---- .../ir/irText/expressions/safeCalls.txt | 2 +- .../testData/ir/irText/expressions/smoke.txt | 28 ++++++------- .../ir/irText/expressions/stringTemplates.txt | 12 +++--- .../testData/ir/irText/expressions/values.txt | 2 +- .../testData/ir/irText/expressions/vararg.txt | 6 +-- .../ir/irText/lambdas/anonymousFunction.txt | 2 +- .../testData/ir/irText/lambdas/justLambda.txt | 2 +- .../lambdas/multipleImplicitReceivers.txt | 10 ++--- 39 files changed, 222 insertions(+), 221 deletions(-) diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt index 3fbfb027a56..e0d3306d13d 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ClassGenerator.kt @@ -92,10 +92,6 @@ class ClassGenerator(val declarationGenerator: DeclarationGenerator) : Generator val irMember = declarationGenerator.generateMemberDeclaration(ktDeclaration) irClass.addMember(irMember) - if (irMember is IrProperty) { - irMember.getter?.let { irClass.addMember(it) } - irMember.setter?.let { irClass.addMember(it) } - } } } } diff --git a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ModuleGenerator.kt b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ModuleGenerator.kt index 4ba36874ab4..7c1981e05d4 100644 --- a/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ModuleGenerator.kt +++ b/compiler/ir/ir.psi2ir/src/org/jetbrains/kotlin/psi2ir/generators/ModuleGenerator.kt @@ -36,14 +36,6 @@ class ModuleGenerator(override val context: GeneratorContext) : Generator { for (ktDeclaration in ktFile.declarations) { val irDeclaration = irDeclarationGenerator.generateMemberDeclaration(ktDeclaration) irFile.addDeclaration(irDeclaration) - if (irDeclaration is IrProperty) { - irDeclaration.getter?.let { - irFile.addDeclaration(it) - } - irDeclaration.setter?.let { - irFile.addDeclaration(it) - } - } } irModule.addFile(irFile) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/IrSlots.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/IrSlots.kt index bcc2246b579..f058858f3e1 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/IrSlots.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/IrSlots.kt @@ -33,4 +33,6 @@ const val LOOP_CONDITION_SLOT = -2 const val SETTER_ARGUMENT_INDEX = 0 const val TRY_RESULT_SLOT = -1 const val FINALLY_EXPRESSION_SLOT = -2 -const val NESTED_INITIALIZERS_SLOT = -1 \ No newline at end of file +const val NESTED_INITIALIZERS_SLOT = -1 +const val PROPERTY_GETTER_SLOT = -1 +const val PROPERTY_SETTER_SLOT = -2 \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt index 58c0743028b..5434e6bbb72 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt @@ -28,8 +28,6 @@ interface IrProperty : IrDeclaration { override val declarationKind: IrDeclarationKind get() = IrDeclarationKind.PROPERTY - - fun acceptAccessors(visitor: IrElementVisitor, data: D) } interface IrSimpleProperty : IrProperty { @@ -49,21 +47,33 @@ abstract class IrPropertyBase( ) : IrDeclarationBase(startOffset, endOffset, origin), IrProperty { override var getter: IrPropertyGetter? = null set(newGetter) { - newGetter?.run { assert(property == null) { "$newGetter: should not have a property" } } - newGetter?.property = this + newGetter?.assertDetached() + field?.detach() field = newGetter + newGetter?.setTreeLocation(this, PROPERTY_GETTER_SLOT) } override var setter: IrPropertySetter? = null set(newSetter) { - newSetter?.run { assert(property == null) { "$newSetter: should not have a property" } } - newSetter?.property = this + newSetter?.assertDetached() + field?.detach() field = newSetter + newSetter?.setTreeLocation(this, PROPERTY_SETTER_SLOT) } - override fun acceptAccessors(visitor: IrElementVisitor, data: D) { - getter?.accept(visitor, data) - setter?.accept(visitor, data) + override fun getChild(slot: Int): IrElement? = + when (slot) { + PROPERTY_GETTER_SLOT -> getter + PROPERTY_SETTER_SLOT -> setter + else -> null + } + + override fun replaceChild(slot: Int, newChild: IrElement) { + when (slot) { + PROPERTY_GETTER_SLOT -> getter = newChild.assertCast() + PROPERTY_SETTER_SLOT -> setter = newChild.assertCast() + else -> throwNoSuchSlot(slot) + } } } @@ -85,13 +95,13 @@ class IrSimplePropertyImpl( override fun getChild(slot: Int): IrElement? = when (slot) { INITIALIZER_SLOT -> valueInitializer - else -> null + else -> super.getChild(slot) } override fun replaceChild(slot: Int, newChild: IrElement) { when (slot) { INITIALIZER_SLOT -> valueInitializer = newChild.assertCast() - else -> throwNoSuchSlot(slot) + else -> super.replaceChild(slot, newChild) } } @@ -100,6 +110,8 @@ class IrSimplePropertyImpl( override fun acceptChildren(visitor: IrElementVisitor, data: D) { valueInitializer?.accept(visitor, data) + getter?.accept(visitor, data) + setter?.accept(visitor, data) } } @@ -121,13 +133,13 @@ class IrDelegatedPropertyImpl( override fun getChild(slot: Int): IrElement? = when (slot) { INITIALIZER_SLOT -> delegateInitializer - else -> null + else -> super.getChild(slot) } override fun replaceChild(slot: Int, newChild: IrElement) { when (slot) { INITIALIZER_SLOT -> delegateInitializer = newChild.assertCast() - else -> throwNoSuchSlot(slot) + else -> super.replaceChild(slot, newChild) } } @@ -136,5 +148,7 @@ class IrDelegatedPropertyImpl( override fun acceptChildren(visitor: IrElementVisitor, data: D) { delegateInitializer.accept(visitor, data) + getter?.accept(visitor, data) + setter?.accept(visitor, data) } } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrPropertyAccessor.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrPropertyAccessor.kt index 2d623354110..b39f3b474f2 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrPropertyAccessor.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrPropertyAccessor.kt @@ -24,7 +24,6 @@ import org.jetbrains.kotlin.ir.visitors.IrElementVisitor interface IrPropertyAccessor : IrFunction { override val descriptor: PropertyAccessorDescriptor - var property: IrProperty? } interface IrPropertyGetter : IrPropertyAccessor { @@ -46,9 +45,7 @@ abstract class IrPropertyAccessorBase( endOffset: Int, origin: IrDeclarationOrigin, body: IrBody -) : IrFunctionBase(startOffset, endOffset, origin, body), IrPropertyAccessor { - override var property: IrProperty? = null -} +) : IrFunctionBase(startOffset, endOffset, origin, body), IrPropertyAccessor class IrPropertyGetterImpl( startOffset: Int, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt index fe0f5625caf..698d7bb90e6 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/RenderIrElement.kt @@ -43,13 +43,13 @@ class RenderIrElementVisitor : IrElementVisitor { "FUN ${declaration.descriptor.render()}" override fun visitProperty(declaration: IrProperty, data: Nothing?): String = - "PROPERTY ${declaration.descriptor.render()} getter=${declaration.getter?.name()} setter=${declaration.setter?.name()}" + "PROPERTY ${declaration.descriptor.render()}" override fun visitPropertyGetter(declaration: IrPropertyGetter, data: Nothing?): String = - "PROPERTY_GETTER ${declaration.descriptor.render()} property=${declaration.property?.name()}" + "PROPERTY_GETTER ${declaration.descriptor.render()}" override fun visitPropertySetter(declaration: IrPropertySetter, data: Nothing?): String = - "PROPERTY_SETTER ${declaration.descriptor.render()} property=${declaration.property?.name()}" + "PROPERTY_SETTER ${declaration.descriptor.render()}" override fun visitClass(declaration: IrClass, data: Nothing?): String = "CLASS ${declaration.descriptor.kind} ${declaration.descriptor.name}" diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt index 666b32a862b..b9de9810e09 100644 --- a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.txt @@ -6,10 +6,10 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD y type=kotlin.Unit operator=null GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val y: kotlin.Int getter=null setter=null + PROPERTY public final val y: kotlin.Int EXPRESSION_BODY GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER CLASS CLASS Test1 diff --git a/compiler/testData/ir/irText/classes/classMembers.txt b/compiler/testData/ir/irText/classes/classMembers.txt index 9c97e2849b5..6d648bbb084 100644 --- a/compiler/testData/ir/irText/classes/classMembers.txt +++ b/compiler/testData/ir/irText/classes/classMembers.txt @@ -8,10 +8,10 @@ FILE /classMembers.kt GET_VAR z type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD property type=kotlin.Unit operator=null CONST Int type=kotlin.Int value='0' - PROPERTY public final val y: kotlin.Int getter=null setter=null + PROPERTY public final val y: kotlin.Int EXPRESSION_BODY GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final var z: kotlin.Int getter=null setter=null + PROPERTY public final var z: kotlin.Int EXPRESSION_BODY GET_VAR z type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER FUN public constructor C() @@ -20,25 +20,25 @@ FILE /classMembers.kt x: CONST Int type=kotlin.Int value='0' y: CONST Int type=kotlin.Int value='0' z: CONST Int type=kotlin.Int value='0' - PROPERTY public final val property: kotlin.Int = 0 getter=null setter=null + PROPERTY public final val property: kotlin.Int = 0 EXPRESSION_BODY CONST Int type=kotlin.Int value='0' - PROPERTY public final val propertyWithGet: kotlin.Int getter= setter=null - PROPERTY_GETTER public final fun (): kotlin.Int property=propertyWithGet - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST Int type=kotlin.Int value='42' - PROPERTY public final var propertyWithGetAndSet: kotlin.Int getter= setter= - PROPERTY_GETTER public final fun (): kotlin.Int property=propertyWithGetAndSet - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CALL . type=kotlin.Int operator=GET_PROPERTY + PROPERTY public final val propertyWithGet: kotlin.Int + PROPERTY_GETTER public final fun (): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST Int type=kotlin.Int value='42' + PROPERTY public final var propertyWithGetAndSet: kotlin.Int + PROPERTY_GETTER public final fun (): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CALL . type=kotlin.Int operator=GET_PROPERTY + $this: THIS public final class C type=C + PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit + BLOCK_BODY + CALL . type=kotlin.Unit operator=EQ $this: THIS public final class C type=C - PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit property=propertyWithGetAndSet - BLOCK_BODY - CALL . type=kotlin.Unit operator=EQ - $this: THIS public final class C type=C - : GET_VAR value type=kotlin.Int operator=null + : GET_VAR value type=kotlin.Int operator=null FUN public final fun function(): kotlin.Unit BLOCK_BODY CALL .println type=kotlin.Unit operator=null diff --git a/compiler/testData/ir/irText/classes/dataClasses.txt b/compiler/testData/ir/irText/classes/dataClasses.txt index da991c905b3..b93e63123c3 100644 --- a/compiler/testData/ir/irText/classes/dataClasses.txt +++ b/compiler/testData/ir/irText/classes/dataClasses.txt @@ -8,13 +8,13 @@ FILE /dataClasses.kt GET_VAR y type=kotlin.String operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD z type=kotlin.Unit operator=null GET_VAR z type=kotlin.Any operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val y: kotlin.String getter=null setter=null + PROPERTY public final val y: kotlin.String EXPRESSION_BODY GET_VAR y type=kotlin.String operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val z: kotlin.Any getter=null setter=null + PROPERTY public final val z: kotlin.Any EXPRESSION_BODY GET_VAR z type=kotlin.Any operator=INITIALIZE_PROPERTY_FROM_PARAMETER FUN public final operator /*synthesized*/ fun component1(): kotlin.Int diff --git a/compiler/testData/ir/irText/classes/initVal.txt b/compiler/testData/ir/irText/classes/initVal.txt index 162bd2f2915..9f5dd2f7f7c 100644 --- a/compiler/testData/ir/irText/classes/initVal.txt +++ b/compiler/testData/ir/irText/classes/initVal.txt @@ -4,7 +4,7 @@ FILE /initVal.kt BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER CLASS CLASS TestInitValInClass @@ -12,7 +12,7 @@ FILE /initVal.kt BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null CONST Int type=kotlin.Int value='0' - PROPERTY public final val x: kotlin.Int = 0 getter=null setter=null + PROPERTY public final val x: kotlin.Int = 0 EXPRESSION_BODY CONST Int type=kotlin.Int value='0' CLASS CLASS TestInitValInInitBlock @@ -21,4 +21,4 @@ FILE /initVal.kt BLOCK type=kotlin.Unit operator=null SET_BACKING_FIELD x type=kotlin.Unit operator=null CONST Int type=kotlin.Int value='0' - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int diff --git a/compiler/testData/ir/irText/classes/initVar.txt b/compiler/testData/ir/irText/classes/initVar.txt index b2f88328398..47a8378a843 100644 --- a/compiler/testData/ir/irText/classes/initVar.txt +++ b/compiler/testData/ir/irText/classes/initVar.txt @@ -4,7 +4,7 @@ FILE /initVar.kt BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final var x: kotlin.Int getter=null setter=null + PROPERTY public final var x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER CLASS CLASS TestInitVarInClass @@ -12,7 +12,7 @@ FILE /initVar.kt BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null CONST Int type=kotlin.Int value='0' - PROPERTY public final var x: kotlin.Int getter=null setter=null + PROPERTY public final var x: kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value='0' CLASS CLASS TestInitVarInInitBlock @@ -22,41 +22,41 @@ FILE /initVar.kt CALL . type=kotlin.Unit operator=EQ $this: THIS public final class TestInitVarInInitBlock type=TestInitVarInInitBlock : CONST Int type=kotlin.Int value='0' - PROPERTY public final var x: kotlin.Int getter=null setter=null + PROPERTY public final var x: kotlin.Int CLASS CLASS TestInitVarWithCustomSetter FUN public constructor TestInitVarWithCustomSetter() BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null CONST Int type=kotlin.Int value='0' - PROPERTY public final var x: kotlin.Int getter=null setter= + PROPERTY public final var x: kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value='0' - PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit property=x - BLOCK_BODY - SET_BACKING_FIELD x type=kotlin.Unit operator=EQ - GET_VAR value type=kotlin.Int operator=null + PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit + BLOCK_BODY + SET_BACKING_FIELD x type=kotlin.Unit operator=EQ + GET_VAR value type=kotlin.Int operator=null CLASS CLASS TestInitVarWithCustomSetterWithExplicitCtor nestedInitializers: BLOCK_BODY BLOCK type=kotlin.Unit operator=null CALL . type=kotlin.Unit operator=EQ $this: THIS public final class TestInitVarWithCustomSetterWithExplicitCtor type=TestInitVarWithCustomSetterWithExplicitCtor value: CONST Int type=kotlin.Int value='0' - PROPERTY public final var x: kotlin.Int getter=null setter= - PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit property=x - BLOCK_BODY - SET_BACKING_FIELD x type=kotlin.Unit operator=EQ - GET_VAR value type=kotlin.Int operator=null + PROPERTY public final var x: kotlin.Int + PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit + BLOCK_BODY + SET_BACKING_FIELD x type=kotlin.Unit operator=EQ + GET_VAR value type=kotlin.Int operator=null FUN public constructor TestInitVarWithCustomSetterWithExplicitCtor() BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL Any NESTED_INITIALIZERS_CALL classDescriptor=TestInitVarWithCustomSetterWithExplicitCtor CLASS CLASS TestInitVarWithCustomSetterInCtor nestedInitializers: BLOCK_BODY - PROPERTY public final var x: kotlin.Int getter=null setter= - PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit property=x - BLOCK_BODY - SET_BACKING_FIELD x type=kotlin.Unit operator=EQ - GET_VAR value type=kotlin.Int operator=null + PROPERTY public final var x: kotlin.Int + PROPERTY_SETTER public final fun (/*0*/ value: kotlin.Int): kotlin.Unit + BLOCK_BODY + SET_BACKING_FIELD x type=kotlin.Unit operator=EQ + GET_VAR value type=kotlin.Int operator=null FUN public constructor TestInitVarWithCustomSetterInCtor() BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL Any diff --git a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt index 31495b65017..3e70bb50a11 100644 --- a/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt +++ b/compiler/testData/ir/irText/classes/objectLiteralExpressions.txt @@ -1,14 +1,14 @@ FILE /objectLiteralExpressions.kt CLASS INTERFACE IFoo FUN public abstract fun foo(): kotlin.Unit - PROPERTY public val test1: kotlin.Any getter=null setter=null + PROPERTY public val test1: kotlin.Any EXPRESSION_BODY BLOCK type=test1. operator=OBJECT_LITERAL CLASS CLASS FUN public constructor () BLOCK_BODY CALL . type=test1. operator=OBJECT_LITERAL - PROPERTY public val test2: IFoo getter=null setter=null + PROPERTY public val test2: IFoo EXPRESSION_BODY BLOCK type=test2. operator=OBJECT_LITERAL CLASS CLASS diff --git a/compiler/testData/ir/irText/classes/primaryConstructor.txt b/compiler/testData/ir/irText/classes/primaryConstructor.txt index 53e7322d3bb..c0300f29818 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructor.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructor.txt @@ -6,10 +6,10 @@ FILE /primaryConstructor.kt GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD y type=kotlin.Unit operator=null GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val y: kotlin.Int getter=null setter=null + PROPERTY public final val y: kotlin.Int EXPRESSION_BODY GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER CLASS CLASS Test2 @@ -19,10 +19,10 @@ FILE /primaryConstructor.kt GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=null - PROPERTY public final val y: kotlin.Int getter=null setter=null + PROPERTY public final val y: kotlin.Int EXPRESSION_BODY GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=null CLASS CLASS Test3 @@ -33,7 +33,7 @@ FILE /primaryConstructor.kt BLOCK type=kotlin.Unit operator=null SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=null - PROPERTY public final val y: kotlin.Int getter=null setter=null + PROPERTY public final val y: kotlin.Int EXPRESSION_BODY GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int diff --git a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt index e91caa0b33c..e2cc396f00d 100644 --- a/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt +++ b/compiler/testData/ir/irText/classes/primaryConstructorWithSuperConstructorCall.txt @@ -18,10 +18,10 @@ FILE /primaryConstructorWithSuperConstructorCall.kt GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER SET_BACKING_FIELD y type=kotlin.Unit operator=null GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val y: kotlin.Int getter=null setter=null + PROPERTY public final val y: kotlin.Int EXPRESSION_BODY GET_VAR y type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER FUN public constructor TestWithDelegatingConstructor(/*0*/ x: kotlin.Int) diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt index b822a97519d..0681b83fec5 100644 --- a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.txt @@ -2,19 +2,19 @@ FILE /qualifiedSuperCalls.kt CLASS INTERFACE ILeft FUN public open fun foo(): kotlin.Unit BLOCK_BODY - PROPERTY public open val bar: kotlin.Int getter= setter=null - PROPERTY_GETTER public open fun (): kotlin.Int property=bar - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST Int type=kotlin.Int value='1' + PROPERTY public open val bar: kotlin.Int + PROPERTY_GETTER public open fun (): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST Int type=kotlin.Int value='1' CLASS INTERFACE IRight FUN public open fun foo(): kotlin.Unit BLOCK_BODY - PROPERTY public open val bar: kotlin.Int getter= setter=null - PROPERTY_GETTER public open fun (): kotlin.Int property=bar - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST Int type=kotlin.Int value='2' + PROPERTY public open val bar: kotlin.Int + PROPERTY_GETTER public open fun (): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST Int type=kotlin.Int value='2' CLASS CLASS CBoth FUN public constructor CBoth() BLOCK_BODY @@ -24,12 +24,12 @@ FILE /qualifiedSuperCalls.kt $this: THIS public final class CBoth : ILeft, IRight type=ILeft CALL .foo superQualifier=IRight type=kotlin.Unit operator=null $this: THIS public final class CBoth : ILeft, IRight type=IRight - PROPERTY public open override /*2*/ val bar: kotlin.Int getter= setter=null - PROPERTY_GETTER public open override /*2*/ fun (): kotlin.Int property=bar - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CALL .plus type=kotlin.Int operator=PLUS - $this: CALL . superQualifier=ILeft type=kotlin.Int operator=GET_PROPERTY - $this: THIS public final class CBoth : ILeft, IRight type=ILeft - other: CALL . superQualifier=IRight type=kotlin.Int operator=GET_PROPERTY - $this: THIS public final class CBoth : ILeft, IRight type=IRight + PROPERTY public open override /*2*/ val bar: kotlin.Int + PROPERTY_GETTER public open override /*2*/ fun (): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CALL .plus type=kotlin.Int operator=PLUS + $this: CALL . superQualifier=ILeft type=kotlin.Int operator=GET_PROPERTY + $this: THIS public final class CBoth : ILeft, IRight type=ILeft + other: CALL . superQualifier=IRight type=kotlin.Int operator=GET_PROPERTY + $this: THIS public final class CBoth : ILeft, IRight type=IRight diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt index fc22951db26..10e81501f4f 100644 --- a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.txt @@ -6,7 +6,7 @@ FILE /secondaryConstructorWithInitializersFromClassBody.kt nestedInitializers: BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null CONST Int type=kotlin.Int value='0' - PROPERTY public final val x: kotlin.Int = 0 getter=null setter=null + PROPERTY public final val x: kotlin.Int = 0 EXPRESSION_BODY CONST Int type=kotlin.Int value='0' FUN public constructor TestProperty() @@ -18,7 +18,7 @@ FILE /secondaryConstructorWithInitializersFromClassBody.kt BLOCK type=kotlin.Unit operator=null SET_BACKING_FIELD x type=kotlin.Unit operator=null CONST Int type=kotlin.Int value='0' - PROPERTY public final val x: kotlin.Int getter=null setter=null + PROPERTY public final val x: kotlin.Int FUN public constructor TestInitBlock() BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL Base diff --git a/compiler/testData/ir/irText/classes/superCalls.txt b/compiler/testData/ir/irText/classes/superCalls.txt index f97be629e10..c5019ce3cc2 100644 --- a/compiler/testData/ir/irText/classes/superCalls.txt +++ b/compiler/testData/ir/irText/classes/superCalls.txt @@ -6,7 +6,7 @@ FILE /superCalls.kt CONST String type=kotlin.String value='' FUN public open fun foo(): kotlin.Unit BLOCK_BODY - PROPERTY public open val bar: kotlin.String = "" getter=null setter=null + PROPERTY public open val bar: kotlin.String = "" EXPRESSION_BODY CONST String type=kotlin.String value='' CLASS CLASS Derived @@ -17,9 +17,9 @@ FILE /superCalls.kt BLOCK_BODY CALL .foo superQualifier=Base type=kotlin.Unit operator=null $this: THIS public final class Derived : Base type=Base - PROPERTY public open override /*1*/ val bar: kotlin.String getter= setter=null - PROPERTY_GETTER public open override /*1*/ fun (): kotlin.String property=bar - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CALL . superQualifier=Base type=kotlin.String operator=GET_PROPERTY - $this: THIS public final class Derived : Base type=Base + PROPERTY public open override /*1*/ val bar: kotlin.String + PROPERTY_GETTER public open override /*1*/ fun (): kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CALL . superQualifier=Base type=kotlin.String operator=GET_PROPERTY + $this: THIS public final class Derived : Base type=Base diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.txt b/compiler/testData/ir/irText/expressions/arrayAccess.txt index 2faf248457a..ccb879eece9 100644 --- a/compiler/testData/ir/irText/expressions/arrayAccess.txt +++ b/compiler/testData/ir/irText/expressions/arrayAccess.txt @@ -1,5 +1,5 @@ FILE /arrayAccess.kt - PROPERTY public val p: kotlin.Int = 0 getter=null setter=null + PROPERTY public val p: kotlin.Int = 0 EXPRESSION_BODY CONST Int type=kotlin.Int value='0' FUN public fun foo(): kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt index 8da6ce0eb1b..9ca8fc43135 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.txt @@ -16,7 +16,7 @@ FILE /arrayAugmentedAssignment1.kt BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final val x: kotlin.IntArray getter=null setter=null + PROPERTY public final val x: kotlin.IntArray EXPRESSION_BODY GET_VAR x type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER FUN public fun testVariable(): kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/assignments.txt b/compiler/testData/ir/irText/expressions/assignments.txt index c3f9e2d7ba1..a8a2a26cd78 100644 --- a/compiler/testData/ir/irText/expressions/assignments.txt +++ b/compiler/testData/ir/irText/expressions/assignments.txt @@ -4,7 +4,7 @@ FILE /assignments.kt BLOCK_BODY SET_BACKING_FIELD x type=kotlin.Unit operator=null GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final var x: kotlin.Int getter=null setter=null + PROPERTY public final var x: kotlin.Int EXPRESSION_BODY GET_VAR x type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER FUN public fun test1(): kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt index 5aec09b1840..da86435ce29 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment1.txt @@ -1,5 +1,5 @@ FILE /augmentedAssignment1.kt - PROPERTY public var p: kotlin.Int getter=null setter=null + PROPERTY public var p: kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value='0' FUN public fun testVariable(): kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt index 9da6092aa97..8953c176239 100644 --- a/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt +++ b/compiler/testData/ir/irText/expressions/augmentedAssignment2.txt @@ -12,7 +12,7 @@ FILE /augmentedAssignment2.kt BLOCK_BODY FUN public operator fun A.modAssign(/*0*/ s: kotlin.String): kotlin.Unit BLOCK_BODY - PROPERTY public val p: A getter=null setter=null + PROPERTY public val p: A EXPRESSION_BODY CALL . type=A operator=null FUN public fun testVariable(): kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/elvis.txt b/compiler/testData/ir/irText/expressions/elvis.txt index ffe31af0994..4b34c975f8c 100644 --- a/compiler/testData/ir/irText/expressions/elvis.txt +++ b/compiler/testData/ir/irText/expressions/elvis.txt @@ -1,5 +1,5 @@ FILE /elvis.kt - PROPERTY public val p: kotlin.Any? = null getter=null setter=null + PROPERTY public val p: kotlin.Any? = null EXPRESSION_BODY CONST Null type=kotlin.Nothing? value='null' FUN public fun foo(): kotlin.Any? diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt index 621582c268c..63be0da9bcc 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.txt @@ -1,9 +1,9 @@ FILE /extensionPropertyGetterCall.kt - PROPERTY public val kotlin.String.okext: kotlin.String getter= setter=null - PROPERTY_GETTER public fun kotlin.String.(): kotlin.String property=okext - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST String type=kotlin.String value='OK' + PROPERTY public val kotlin.String.okext: kotlin.String + PROPERTY_GETTER public fun kotlin.String.(): kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST String type=kotlin.String value='OK' FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from=test5 diff --git a/compiler/testData/ir/irText/expressions/field.txt b/compiler/testData/ir/irText/expressions/field.txt index 64db032ca5e..e5095f2bf8e 100644 --- a/compiler/testData/ir/irText/expressions/field.txt +++ b/compiler/testData/ir/irText/expressions/field.txt @@ -1,17 +1,17 @@ FILE /field.kt - PROPERTY public var testSimple: kotlin.Int getter=null setter= + PROPERTY public var testSimple: kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value='0' - PROPERTY_SETTER public fun (/*0*/ value: kotlin.Int): kotlin.Unit property=testSimple - BLOCK_BODY - SET_BACKING_FIELD testSimple type=kotlin.Unit operator=EQ - GET_VAR value type=kotlin.Int operator=null - PROPERTY public var testAugmented: kotlin.Int getter=null setter= + PROPERTY_SETTER public fun (/*0*/ value: kotlin.Int): kotlin.Unit + BLOCK_BODY + SET_BACKING_FIELD testSimple type=kotlin.Unit operator=EQ + GET_VAR value type=kotlin.Int operator=null + PROPERTY public var testAugmented: kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value='0' - PROPERTY_SETTER public fun (/*0*/ value: kotlin.Int): kotlin.Unit property=testAugmented - BLOCK_BODY - SET_BACKING_FIELD testAugmented type=kotlin.Unit operator=PLUSEQ - CALL .plus type=kotlin.Int operator=PLUSEQ - $this: GET_BACKING_FIELD testAugmented type=kotlin.Int operator=PLUSEQ - other: GET_VAR value type=kotlin.Int operator=null + PROPERTY_SETTER public fun (/*0*/ value: kotlin.Int): kotlin.Unit + BLOCK_BODY + SET_BACKING_FIELD testAugmented type=kotlin.Unit operator=PLUSEQ + CALL .plus type=kotlin.Int operator=PLUSEQ + $this: GET_BACKING_FIELD testAugmented type=kotlin.Int operator=PLUSEQ + other: GET_VAR value type=kotlin.Int operator=null diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt index 59784e0c9fc..c7c4bf5dc0f 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.txt @@ -7,7 +7,7 @@ FILE /forWithImplicitReceivers.kt BLOCK_BODY SET_BACKING_FIELD value type=kotlin.Unit operator=null GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final var value: kotlin.Int getter=null setter=null + PROPERTY public final var value: kotlin.Int EXPRESSION_BODY GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER CLASS INTERFACE IReceiver diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.txt index 5591d2dd75d..b7f650f1679 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.txt @@ -1,8 +1,8 @@ FILE /incrementDecrement.kt - PROPERTY public var p: kotlin.Int getter=null setter=null + PROPERTY public var p: kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value='0' - PROPERTY public val arr: kotlin.IntArray getter=null setter=null + PROPERTY public val arr: kotlin.IntArray EXPRESSION_BODY CALL .intArrayOf type=kotlin.IntArray operator=null elements: VARARG type=IntArray varargElementType=Int diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt index b1e6ea937be..d9aa362e131 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.txt @@ -5,21 +5,21 @@ FILE /jvmStaticFieldReference.kt $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream CALL . type=java.io.PrintStream! operator=GET_PROPERTY p0: CONST String type=kotlin.String value='testFun' - PROPERTY public var testProp: kotlin.Any getter= setter= - PROPERTY_GETTER public fun (): kotlin.Any property=testProp - BLOCK_BODY - CALL .println type=kotlin.Unit operator=null - $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - CALL . type=java.io.PrintStream! operator=GET_PROPERTY - p0: CONST String type=kotlin.String value='testProp/get' - RETURN type=kotlin.Nothing from= - CONST Int type=kotlin.Int value='42' - PROPERTY_SETTER public fun (/*0*/ value: kotlin.Any): kotlin.Unit property=testProp - BLOCK_BODY - CALL .println type=kotlin.Unit operator=null - $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream - CALL . type=java.io.PrintStream! operator=GET_PROPERTY - p0: CONST String type=kotlin.String value='testProp/set' + PROPERTY public var testProp: kotlin.Any + PROPERTY_GETTER public fun (): kotlin.Any + BLOCK_BODY + CALL .println type=kotlin.Unit operator=null + $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + CALL . type=java.io.PrintStream! operator=GET_PROPERTY + p0: CONST String type=kotlin.String value='testProp/get' + RETURN type=kotlin.Nothing from= + CONST Int type=kotlin.Int value='42' + PROPERTY_SETTER public fun (/*0*/ value: kotlin.Any): kotlin.Unit + BLOCK_BODY + CALL .println type=kotlin.Unit operator=null + $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream + CALL . type=java.io.PrintStream! operator=GET_PROPERTY + p0: CONST String type=kotlin.String value='testProp/set' CLASS CLASS TestClass FUN public constructor TestClass() BLOCK_BODY @@ -36,7 +36,7 @@ FILE /jvmStaticFieldReference.kt $this: TYPE_OP operator=IMPLICIT_NOTNULL typeOperand=java.io.PrintStream CALL . type=java.io.PrintStream! operator=GET_PROPERTY p0: CONST String type=kotlin.String value='TestClass/init' - PROPERTY public final val test: kotlin.Int getter=null setter=null + PROPERTY public final val test: kotlin.Int EXPRESSION_BODY WHEN type=kotlin.Int operator=WHEN else: BLOCK type=kotlin.Int operator=null diff --git a/compiler/testData/ir/irText/expressions/literals.txt b/compiler/testData/ir/irText/expressions/literals.txt index e72b0ddf8b8..38cca831037 100644 --- a/compiler/testData/ir/irText/expressions/literals.txt +++ b/compiler/testData/ir/irText/expressions/literals.txt @@ -1,40 +1,40 @@ FILE /literals.kt - PROPERTY public val test1: kotlin.Int = 1 getter=null setter=null + PROPERTY public val test1: kotlin.Int = 1 EXPRESSION_BODY CONST Int type=kotlin.Int value='1' - PROPERTY public val test2: kotlin.Int = -1 getter=null setter=null + PROPERTY public val test2: kotlin.Int = -1 EXPRESSION_BODY CONST Int type=kotlin.Int value='-1' - PROPERTY public val test3: kotlin.Boolean = true getter=null setter=null + PROPERTY public val test3: kotlin.Boolean = true EXPRESSION_BODY CONST Boolean type=kotlin.Boolean value='true' - PROPERTY public val test4: kotlin.Boolean = false getter=null setter=null + PROPERTY public val test4: kotlin.Boolean = false EXPRESSION_BODY CONST Boolean type=kotlin.Boolean value='false' - PROPERTY public val test5: kotlin.String = "abc" getter=null setter=null + PROPERTY public val test5: kotlin.String = "abc" EXPRESSION_BODY CONST String type=kotlin.String value='abc' - PROPERTY public val test6: kotlin.Nothing? = null getter=null setter=null + PROPERTY public val test6: kotlin.Nothing? = null EXPRESSION_BODY CONST Null type=kotlin.Nothing? value='null' - PROPERTY public val test7: kotlin.Long = 1.toLong() getter=null setter=null + PROPERTY public val test7: kotlin.Long = 1.toLong() EXPRESSION_BODY CONST Long type=kotlin.Long value='1' - PROPERTY public val test8: kotlin.Long = -1.toLong() getter=null setter=null + PROPERTY public val test8: kotlin.Long = -1.toLong() EXPRESSION_BODY CONST Long type=kotlin.Long value='-1' - PROPERTY public val test9: kotlin.Double = 1.0.toDouble() getter=null setter=null + PROPERTY public val test9: kotlin.Double = 1.0.toDouble() EXPRESSION_BODY CONST Double type=kotlin.Double value='1.0' - PROPERTY public val test10: kotlin.Double = -1.0.toDouble() getter=null setter=null + PROPERTY public val test10: kotlin.Double = -1.0.toDouble() EXPRESSION_BODY CONST Double type=kotlin.Double value='-1.0' - PROPERTY public val test11: kotlin.Float = 1.0.toFloat() getter=null setter=null + PROPERTY public val test11: kotlin.Float = 1.0.toFloat() EXPRESSION_BODY CONST Float type=kotlin.Float value='1.0' - PROPERTY public val test12: kotlin.Float = -1.0.toFloat() getter=null setter=null + PROPERTY public val test12: kotlin.Float = -1.0.toFloat() EXPRESSION_BODY CONST Float type=kotlin.Float value='-1.0' - PROPERTY public val test13: kotlin.Char = \u0061 ('a') getter=null setter=null + PROPERTY public val test13: kotlin.Char = \u0061 ('a') EXPRESSION_BODY CONST Char type=kotlin.Char value='a' diff --git a/compiler/testData/ir/irText/expressions/references.txt b/compiler/testData/ir/irText/expressions/references.txt index 87320937381..71334c4b1f0 100644 --- a/compiler/testData/ir/irText/expressions/references.txt +++ b/compiler/testData/ir/irText/expressions/references.txt @@ -1,15 +1,15 @@ FILE /references.kt - PROPERTY public val ok: kotlin.String = "OK" getter=null setter=null + PROPERTY public val ok: kotlin.String = "OK" EXPRESSION_BODY CONST String type=kotlin.String value='OK' - PROPERTY public val ok2: kotlin.String = "OK" getter=null setter=null + PROPERTY public val ok2: kotlin.String = "OK" EXPRESSION_BODY CALL . type=kotlin.String operator=GET_PROPERTY - PROPERTY public val ok3: kotlin.String getter= setter=null - PROPERTY_GETTER public fun (): kotlin.String property=ok3 - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST String type=kotlin.String value='OK' + PROPERTY public val ok3: kotlin.String + PROPERTY_GETTER public fun (): kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST String type=kotlin.String value='OK' FUN public fun test1(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from=test1 @@ -28,11 +28,11 @@ FILE /references.kt BLOCK_BODY RETURN type=kotlin.Nothing from=test4 CALL . type=kotlin.String operator=GET_PROPERTY - PROPERTY public val kotlin.String.okext: kotlin.String getter= setter=null - PROPERTY_GETTER public fun kotlin.String.(): kotlin.String property=okext - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST String type=kotlin.String value='OK' + PROPERTY public val kotlin.String.okext: kotlin.String + PROPERTY_GETTER public fun kotlin.String.(): kotlin.String + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST String type=kotlin.String value='OK' FUN public fun kotlin.String.test5(): kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from=test5 diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt index a2545426a9c..3762c4bde4a 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.txt @@ -2,13 +2,13 @@ FILE /safeCallWithIncrementDecrement.kt CLASS CLASS C FUN public constructor C() BLOCK_BODY - PROPERTY public var test.C?.p: kotlin.Int getter= setter= - PROPERTY_GETTER public fun test.C?.(): kotlin.Int property=p - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST Int type=kotlin.Int value='42' - PROPERTY_SETTER public fun test.C?.(/*0*/ value: kotlin.Int): kotlin.Unit property=p - BLOCK_BODY + PROPERTY public var test.C?.p: kotlin.Int + PROPERTY_GETTER public fun test.C?.(): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST Int type=kotlin.Int value='42' + PROPERTY_SETTER public fun test.C?.(/*0*/ value: kotlin.Int): kotlin.Unit + BLOCK_BODY FUN public operator fun kotlin.Int?.inc(): kotlin.Int? BLOCK_BODY RETURN type=kotlin.Nothing from=inc diff --git a/compiler/testData/ir/irText/expressions/safeCalls.txt b/compiler/testData/ir/irText/expressions/safeCalls.txt index d8c0d04f49f..534f5151159 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.txt @@ -4,7 +4,7 @@ FILE /safeCalls.kt BLOCK_BODY SET_BACKING_FIELD value type=kotlin.Unit operator=null GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER - PROPERTY public final var value: kotlin.Int getter=null setter=null + PROPERTY public final var value: kotlin.Int EXPRESSION_BODY GET_VAR value type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER CLASS INTERFACE IHost diff --git a/compiler/testData/ir/irText/expressions/smoke.txt b/compiler/testData/ir/irText/expressions/smoke.txt index 0df61010155..4cab5db661e 100644 --- a/compiler/testData/ir/irText/expressions/smoke.txt +++ b/compiler/testData/ir/irText/expressions/smoke.txt @@ -3,21 +3,21 @@ FILE /smoke.kt BLOCK_BODY RETURN type=kotlin.Nothing from=testFun CONST String type=kotlin.String value='OK' - PROPERTY public val testSimpleVal: kotlin.Int = 1 getter=null setter=null + PROPERTY public val testSimpleVal: kotlin.Int = 1 EXPRESSION_BODY CONST Int type=kotlin.Int value='1' - PROPERTY public val testValWithGetter: kotlin.Int getter= setter=null - PROPERTY_GETTER public fun (): kotlin.Int property=testValWithGetter - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST Int type=kotlin.Int value='42' - PROPERTY public var testSimpleVar: kotlin.Int getter=null setter=null + PROPERTY public val testValWithGetter: kotlin.Int + PROPERTY_GETTER public fun (): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST Int type=kotlin.Int value='42' + PROPERTY public var testSimpleVar: kotlin.Int EXPRESSION_BODY CONST Int type=kotlin.Int value='2' - PROPERTY public var testVarWithAccessors: kotlin.Int getter= setter= - PROPERTY_GETTER public fun (): kotlin.Int property=testVarWithAccessors - BLOCK_BODY - RETURN type=kotlin.Nothing from= - CONST Int type=kotlin.Int value='42' - PROPERTY_SETTER public fun (/*0*/ v: kotlin.Int): kotlin.Unit property=testVarWithAccessors - BLOCK_BODY + PROPERTY public var testVarWithAccessors: kotlin.Int + PROPERTY_GETTER public fun (): kotlin.Int + BLOCK_BODY + RETURN type=kotlin.Nothing from= + CONST Int type=kotlin.Int value='42' + PROPERTY_SETTER public fun (/*0*/ v: kotlin.Int): kotlin.Unit + BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/stringTemplates.txt b/compiler/testData/ir/irText/expressions/stringTemplates.txt index d1ed1bf8907..9f028bcf7a0 100644 --- a/compiler/testData/ir/irText/expressions/stringTemplates.txt +++ b/compiler/testData/ir/irText/expressions/stringTemplates.txt @@ -3,21 +3,21 @@ FILE /stringTemplates.kt BLOCK_BODY RETURN type=kotlin.Nothing from=foo CONST String type=kotlin.String value='' - PROPERTY public val test1: kotlin.String = "" getter=null setter=null + PROPERTY public val test1: kotlin.String = "" EXPRESSION_BODY CONST String type=kotlin.String value='' - PROPERTY public val test2: kotlin.String = "abc" getter=null setter=null + PROPERTY public val test2: kotlin.String = "abc" EXPRESSION_BODY CONST String type=kotlin.String value='abc' - PROPERTY public val test3: kotlin.String = "" getter=null setter=null + PROPERTY public val test3: kotlin.String = "" EXPRESSION_BODY CONST String type=kotlin.String value='' - PROPERTY public val test4: kotlin.String = "abc" getter=null setter=null + PROPERTY public val test4: kotlin.String = "abc" EXPRESSION_BODY CONST String type=kotlin.String value='abc' PROPERTY public val test5: kotlin.String = " abc -" getter=null setter=null +" EXPRESSION_BODY STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value=' @@ -25,7 +25,7 @@ abc CONST String type=kotlin.String value='abc' CONST String type=kotlin.String value=' ' - PROPERTY public val test6: kotlin.String getter=null setter=null + PROPERTY public val test6: kotlin.String EXPRESSION_BODY STRING_CONCATENATION type=kotlin.String CALL . type=kotlin.String operator=GET_PROPERTY diff --git a/compiler/testData/ir/irText/expressions/values.txt b/compiler/testData/ir/irText/expressions/values.txt index 31c2ea1e6ef..8aff99d6bf3 100644 --- a/compiler/testData/ir/irText/expressions/values.txt +++ b/compiler/testData/ir/irText/expressions/values.txt @@ -8,7 +8,7 @@ FILE /values.kt CLASS OBJECT A FUN private constructor A() BLOCK_BODY - PROPERTY public val a: kotlin.Int = 0 getter=null setter=null + PROPERTY public val a: kotlin.Int = 0 EXPRESSION_BODY CONST Int type=kotlin.Int value='0' CLASS CLASS Z diff --git a/compiler/testData/ir/irText/expressions/vararg.txt b/compiler/testData/ir/irText/expressions/vararg.txt index 25c413eec92..f613ab5bd96 100644 --- a/compiler/testData/ir/irText/expressions/vararg.txt +++ b/compiler/testData/ir/irText/expressions/vararg.txt @@ -1,15 +1,15 @@ FILE /vararg.kt - PROPERTY public val test1: kotlin.Array getter=null setter=null + PROPERTY public val test1: kotlin.Array EXPRESSION_BODY CALL .arrayOf type=kotlin.Array operator=null - PROPERTY public val test2: kotlin.Array getter=null setter=null + PROPERTY public val test2: kotlin.Array EXPRESSION_BODY CALL .arrayOf type=kotlin.Array operator=null elements: VARARG type=Array varargElementType=String CONST String type=kotlin.String value='1' CONST String type=kotlin.String value='2' CONST String type=kotlin.String value='3' - PROPERTY public val test3: kotlin.Array getter=null setter=null + PROPERTY public val test3: kotlin.Array EXPRESSION_BODY CALL .arrayOf type=kotlin.Array operator=null elements: VARARG type=Array varargElementType=String diff --git a/compiler/testData/ir/irText/lambdas/anonymousFunction.txt b/compiler/testData/ir/irText/lambdas/anonymousFunction.txt index 6fec27ddc6f..46889b98101 100644 --- a/compiler/testData/ir/irText/lambdas/anonymousFunction.txt +++ b/compiler/testData/ir/irText/lambdas/anonymousFunction.txt @@ -1,5 +1,5 @@ FILE /anonymousFunction.kt - PROPERTY public val anonymous: () -> kotlin.Unit getter=null setter=null + PROPERTY public val anonymous: () -> kotlin.Unit EXPRESSION_BODY BLOCK type=() -> kotlin.Unit operator=ANONYMOUS_FUNCTION FUN local final fun (): kotlin.Unit diff --git a/compiler/testData/ir/irText/lambdas/justLambda.txt b/compiler/testData/ir/irText/lambdas/justLambda.txt index b1bd148be8d..5dd9772288c 100644 --- a/compiler/testData/ir/irText/lambdas/justLambda.txt +++ b/compiler/testData/ir/irText/lambdas/justLambda.txt @@ -1,5 +1,5 @@ FILE /justLambda.kt - PROPERTY public val lambda: () -> kotlin.Int getter=null setter=null + PROPERTY public val lambda: () -> kotlin.Int EXPRESSION_BODY BLOCK type=() -> kotlin.Int operator=LAMBDA FUN local final fun (): kotlin.Int diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt index 6f430e2fb93..2c88052ccd7 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.txt @@ -6,11 +6,11 @@ FILE /multipleImplicitReceivers.kt FUN private constructor B() BLOCK_BODY CLASS INTERFACE IFoo - PROPERTY public open val A.foo: B getter= setter=null - PROPERTY_GETTER public open fun A.(): B property=foo - BLOCK_BODY - RETURN type=kotlin.Nothing from= - GET_OBJECT B type=B + PROPERTY public open val A.foo: B + PROPERTY_GETTER public open fun A.(): B + BLOCK_BODY + RETURN type=kotlin.Nothing from= + GET_OBJECT B type=B CLASS INTERFACE IInvoke FUN public open operator fun B.invoke(): kotlin.Int BLOCK_BODY