Properties declared in primary constructors should have proper accessors in IR.
This commit is contained in:
committed by
Dmitry Petrov
parent
5c720845a8
commit
201d2414bc
@@ -212,7 +212,8 @@ class ClassGenerator(val declarationGenerator: DeclarationGenerator) : Generator
|
|||||||
ktClassOrObject.getPrimaryConstructor()?.let { ktPrimaryConstructor ->
|
ktClassOrObject.getPrimaryConstructor()?.let { ktPrimaryConstructor ->
|
||||||
for (ktParameter in ktPrimaryConstructor.valueParameters) {
|
for (ktParameter in ktPrimaryConstructor.valueParameters) {
|
||||||
if (ktParameter.hasValOrVar()) {
|
if (ktParameter.hasValOrVar()) {
|
||||||
irClass.addMember(generatePropertyForPrimaryConstructorParameter(ktParameter))
|
val irProperty = PropertyGenerator(declarationGenerator).generatePropertyForPrimaryConstructorParameter(ktParameter)
|
||||||
|
irClass.addMember(irProperty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -227,18 +228,6 @@ class ClassGenerator(val declarationGenerator: DeclarationGenerator) : Generator
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun generatePropertyForPrimaryConstructorParameter(ktParameter: KtParameter): IrDeclaration {
|
|
||||||
val valueParameterDescriptor = getOrFail(BindingContext.VALUE_PARAMETER, ktParameter)
|
|
||||||
val propertyDescriptor = getOrFail(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, ktParameter)
|
|
||||||
val irProperty = IrPropertyImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.DEFINED, false, propertyDescriptor)
|
|
||||||
val irField = IrFieldImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, propertyDescriptor)
|
|
||||||
irProperty.backingField = irField
|
|
||||||
val irGetParameter = IrGetVariableImpl(ktParameter.startOffset, ktParameter.endOffset,
|
|
||||||
valueParameterDescriptor, IrOperator.INITIALIZE_PROPERTY_FROM_PARAMETER)
|
|
||||||
irField.initializer = IrExpressionBodyImpl(ktParameter.startOffset, ktParameter.endOffset, irGetParameter)
|
|
||||||
return irProperty
|
|
||||||
}
|
|
||||||
|
|
||||||
fun generateEnumEntry(ktEnumEntry: KtEnumEntry): IrEnumEntry {
|
fun generateEnumEntry(ktEnumEntry: KtEnumEntry): IrEnumEntry {
|
||||||
val enumEntryDescriptor = getOrFail(BindingContext.CLASS, ktEnumEntry)
|
val enumEntryDescriptor = getOrFail(BindingContext.CLASS, ktEnumEntry)
|
||||||
val irEnumEntry = IrEnumEntryImpl(ktEnumEntry.startOffset, ktEnumEntry.endOffset, IrDeclarationOrigin.DEFINED, enumEntryDescriptor)
|
val irEnumEntry = IrEnumEntryImpl(ktEnumEntry.startOffset, ktEnumEntry.endOffset, IrDeclarationOrigin.DEFINED, enumEntryDescriptor)
|
||||||
|
|||||||
+5
-108
@@ -16,12 +16,12 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.psi2ir.generators
|
package org.jetbrains.kotlin.psi2ir.generators
|
||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.*
|
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||||
|
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||||
import org.jetbrains.kotlin.ir.declarations.*
|
import org.jetbrains.kotlin.ir.declarations.*
|
||||||
import org.jetbrains.kotlin.ir.declarations.impl.*
|
import org.jetbrains.kotlin.ir.declarations.impl.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrBody
|
import org.jetbrains.kotlin.ir.expressions.IrBody
|
||||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
|
||||||
import org.jetbrains.kotlin.psi.*
|
import org.jetbrains.kotlin.psi.*
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
||||||
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||||
@@ -34,7 +34,7 @@ class DeclarationGenerator(override val context: GeneratorContext) : Generator {
|
|||||||
is KtNamedFunction ->
|
is KtNamedFunction ->
|
||||||
generateFunctionDeclaration(ktDeclaration)
|
generateFunctionDeclaration(ktDeclaration)
|
||||||
is KtProperty ->
|
is KtProperty ->
|
||||||
generatePropertyDeclaration(ktDeclaration)
|
PropertyGenerator(this).generatePropertyDeclaration(ktDeclaration)
|
||||||
is KtClassOrObject ->
|
is KtClassOrObject ->
|
||||||
generateClassOrObjectDeclaration(ktDeclaration)
|
generateClassOrObjectDeclaration(ktDeclaration)
|
||||||
is KtTypeAlias ->
|
is KtTypeAlias ->
|
||||||
@@ -106,113 +106,10 @@ class DeclarationGenerator(override val context: GeneratorContext) : Generator {
|
|||||||
return irConstructor
|
return irConstructor
|
||||||
}
|
}
|
||||||
|
|
||||||
fun generatePropertyDeclaration(ktProperty: KtProperty): IrProperty {
|
fun generateFunctionBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrBody =
|
||||||
val propertyDescriptor = getPropertyDescriptor(ktProperty)
|
|
||||||
val ktDelegate = ktProperty.delegate
|
|
||||||
return if (ktDelegate != null)
|
|
||||||
generateDelegatedProperty(ktProperty, ktDelegate, propertyDescriptor)
|
|
||||||
else
|
|
||||||
generateSimpleProperty(ktProperty, propertyDescriptor)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generateDelegatedProperty(ktProperty: KtProperty, ktDelegate: KtPropertyDelegate, propertyDescriptor: PropertyDescriptor): IrProperty {
|
|
||||||
val ktDelegateExpression = ktDelegate.expression!!
|
|
||||||
val irDelegateInitializer = generateInitializerBody(propertyDescriptor, ktDelegateExpression)
|
|
||||||
return DelegatedPropertyGenerator(context).generateDelegatedProperty(ktProperty, ktDelegate, propertyDescriptor, irDelegateInitializer)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generateSimpleProperty(ktProperty: KtProperty, propertyDescriptor: PropertyDescriptor): IrProperty {
|
|
||||||
val irProperty = IrPropertyImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.DEFINED, false, propertyDescriptor)
|
|
||||||
|
|
||||||
val irField = if (propertyDescriptor.hasBackingField()) {
|
|
||||||
IrFieldImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, propertyDescriptor,
|
|
||||||
ktProperty.initializer?.let { generateInitializerBody(propertyDescriptor, it) })
|
|
||||||
}
|
|
||||||
else null
|
|
||||||
irProperty.backingField = irField
|
|
||||||
|
|
||||||
irProperty.getter = ktProperty.getter?.let { ktGetter ->
|
|
||||||
val accessorDescriptor = getOrFail(BindingContext.PROPERTY_ACCESSOR, ktGetter)
|
|
||||||
val getterDescriptor = accessorDescriptor as? PropertyGetterDescriptor ?: TODO("not a getter?")
|
|
||||||
val irGetter = IrFunctionImpl(ktGetter.startOffset, ktGetter.endOffset, IrDeclarationOrigin.DEFINED, getterDescriptor)
|
|
||||||
irGetter.body = ktGetter.bodyExpression?.let { generateFunctionBody(getterDescriptor, it ) }
|
|
||||||
irGetter
|
|
||||||
} ?: generateDefaultGetterIfRequired(ktProperty, irField)
|
|
||||||
|
|
||||||
irProperty.setter = ktProperty.setter?.let { ktSetter ->
|
|
||||||
val accessorDescriptor = getOrFail(BindingContext.PROPERTY_ACCESSOR, ktSetter)
|
|
||||||
val setterDescriptor = accessorDescriptor as? PropertySetterDescriptor ?: TODO("not a setter?")
|
|
||||||
val irSetter = IrFunctionImpl(ktSetter.startOffset, ktSetter.endOffset, IrDeclarationOrigin.DEFINED, setterDescriptor)
|
|
||||||
irSetter.body = ktSetter.bodyExpression?.let { generateFunctionBody(setterDescriptor, it ) }
|
|
||||||
irSetter
|
|
||||||
} ?: generateDefaultSetterIfRequired(ktProperty, irField)
|
|
||||||
|
|
||||||
return irProperty
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun PropertyDescriptor.hasBackingField(): Boolean =
|
|
||||||
get(BindingContext.BACKING_FIELD_REQUIRED, this) ?: false
|
|
||||||
|
|
||||||
private fun generateDefaultGetterIfRequired(ktProperty: KtProperty, irField: IrField?): IrFunction? {
|
|
||||||
if (irField == null) return null
|
|
||||||
|
|
||||||
val property = irField.descriptor
|
|
||||||
val getter = property.getter ?: return null
|
|
||||||
|
|
||||||
val irGetter = IrFunctionImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR, getter)
|
|
||||||
val irBody = IrBlockBodyImpl(ktProperty.startOffset, ktProperty.endOffset)
|
|
||||||
irGetter.body = irBody
|
|
||||||
|
|
||||||
val containingDeclaration = property.containingDeclaration
|
|
||||||
val receiver =
|
|
||||||
if (containingDeclaration is ClassDescriptor)
|
|
||||||
IrThisReferenceImpl(ktProperty.startOffset, ktProperty.endOffset, containingDeclaration.defaultType,
|
|
||||||
containingDeclaration)
|
|
||||||
else
|
|
||||||
null
|
|
||||||
|
|
||||||
irBody.addStatement(IrReturnImpl(ktProperty.startOffset, ktProperty.endOffset, context.builtIns.nothingType, getter,
|
|
||||||
IrGetFieldImpl(ktProperty.startOffset, ktProperty.endOffset, property, receiver)))
|
|
||||||
|
|
||||||
return irGetter
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generateDefaultSetterIfRequired(ktProperty: KtProperty, irField: IrField?): IrFunction? {
|
|
||||||
if (irField == null) return null
|
|
||||||
|
|
||||||
val property = irField.descriptor
|
|
||||||
if (!property.isVar) return null
|
|
||||||
val setter = property.setter ?: return null
|
|
||||||
|
|
||||||
val irSetter = IrFunctionImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR, setter)
|
|
||||||
val irBody = IrBlockBodyImpl(ktProperty.startOffset, ktProperty.endOffset)
|
|
||||||
irSetter.body = irBody
|
|
||||||
|
|
||||||
val containingDeclaration = property.containingDeclaration
|
|
||||||
val receiver =
|
|
||||||
if (containingDeclaration is ClassDescriptor)
|
|
||||||
IrThisReferenceImpl(ktProperty.startOffset, ktProperty.endOffset, containingDeclaration.defaultType,
|
|
||||||
containingDeclaration)
|
|
||||||
else
|
|
||||||
null
|
|
||||||
|
|
||||||
val setterParameter = setter.valueParameters.single()
|
|
||||||
irBody.addStatement(IrSetFieldImpl(ktProperty.startOffset, ktProperty.endOffset, property, receiver,
|
|
||||||
IrGetVariableImpl(ktProperty.startOffset, ktProperty.endOffset, setterParameter)))
|
|
||||||
|
|
||||||
return irSetter
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun getPropertyDescriptor(ktProperty: KtProperty): PropertyDescriptor {
|
|
||||||
val variableDescriptor = getOrFail(BindingContext.VARIABLE, ktProperty)
|
|
||||||
val propertyDescriptor = variableDescriptor as? PropertyDescriptor ?: TODO("not a property?")
|
|
||||||
return propertyDescriptor
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun generateFunctionBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrBody =
|
|
||||||
createBodyGenerator(scopeOwner).generateFunctionBody(ktBody)
|
createBodyGenerator(scopeOwner).generateFunctionBody(ktBody)
|
||||||
|
|
||||||
private fun generateInitializerBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrExpressionBody =
|
fun generateInitializerBody(scopeOwner: CallableDescriptor, ktBody: KtExpression): IrExpressionBody =
|
||||||
createBodyGenerator(scopeOwner).generatePropertyInitializerBody(ktBody)
|
createBodyGenerator(scopeOwner).generatePropertyInitializerBody(ktBody)
|
||||||
|
|
||||||
private fun createBodyGenerator(descriptor: CallableDescriptor) =
|
private fun createBodyGenerator(descriptor: CallableDescriptor) =
|
||||||
|
|||||||
+185
@@ -0,0 +1,185 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2016 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.psi2ir.generators
|
||||||
|
|
||||||
|
import org.jetbrains.kotlin.descriptors.ClassDescriptor
|
||||||
|
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||||
|
import org.jetbrains.kotlin.descriptors.PropertyGetterDescriptor
|
||||||
|
import org.jetbrains.kotlin.descriptors.PropertySetterDescriptor
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.IrProperty
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
|
||||||
|
import org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl
|
||||||
|
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
|
||||||
|
import org.jetbrains.kotlin.ir.expressions.IrOperator
|
||||||
|
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||||
|
import org.jetbrains.kotlin.psi.KtElement
|
||||||
|
import org.jetbrains.kotlin.psi.KtParameter
|
||||||
|
import org.jetbrains.kotlin.psi.KtProperty
|
||||||
|
import org.jetbrains.kotlin.psi.KtPropertyDelegate
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
||||||
|
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||||
|
import org.jetbrains.kotlin.resolve.BindingContext
|
||||||
|
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||||
|
|
||||||
|
class PropertyGenerator(val declarationGenerator: DeclarationGenerator) : Generator {
|
||||||
|
override val context: GeneratorContext get() = declarationGenerator.context
|
||||||
|
|
||||||
|
fun generatePropertyDeclaration(ktProperty: KtProperty): IrProperty {
|
||||||
|
val propertyDescriptor = getPropertyDescriptor(ktProperty)
|
||||||
|
val ktDelegate = ktProperty.delegate
|
||||||
|
return if (ktDelegate != null)
|
||||||
|
generateDelegatedProperty(ktProperty, ktDelegate, propertyDescriptor)
|
||||||
|
else
|
||||||
|
generateSimpleProperty(ktProperty, propertyDescriptor)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun generatePropertyForPrimaryConstructorParameter(ktParameter: KtParameter): IrDeclaration {
|
||||||
|
val valueParameterDescriptor = getOrFail(BindingContext.VALUE_PARAMETER, ktParameter)
|
||||||
|
val propertyDescriptor = getOrFail(BindingContext.PRIMARY_CONSTRUCTOR_PARAMETER, ktParameter)
|
||||||
|
|
||||||
|
val irProperty = IrPropertyImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.DEFINED, false, propertyDescriptor)
|
||||||
|
|
||||||
|
val irField = IrFieldImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, propertyDescriptor)
|
||||||
|
val irGetParameter = IrGetVariableImpl(ktParameter.startOffset, ktParameter.endOffset,
|
||||||
|
valueParameterDescriptor, IrOperator.INITIALIZE_PROPERTY_FROM_PARAMETER)
|
||||||
|
irField.initializer = IrExpressionBodyImpl(ktParameter.startOffset, ktParameter.endOffset, irGetParameter)
|
||||||
|
irProperty.backingField = irField
|
||||||
|
|
||||||
|
val getter = propertyDescriptor.getter ?:
|
||||||
|
throw AssertionError("Property declared in primary constructor has no getter: $propertyDescriptor")
|
||||||
|
val irGetter = IrFunctionImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR, getter)
|
||||||
|
irProperty.getter = irGetter
|
||||||
|
irGetter.body = generateDefaultGetterBody(ktParameter, getter)
|
||||||
|
|
||||||
|
if (propertyDescriptor.isVar) {
|
||||||
|
val setter = propertyDescriptor.setter ?:
|
||||||
|
throw AssertionError("Property declared in primary constructor has no setter: $propertyDescriptor")
|
||||||
|
val irSetter = IrFunctionImpl(ktParameter.startOffset, ktParameter.endOffset, IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR, setter)
|
||||||
|
irSetter.body = generateDefaultSetterBody(ktParameter, setter)
|
||||||
|
irProperty.setter = irSetter
|
||||||
|
}
|
||||||
|
|
||||||
|
return irProperty
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateDelegatedProperty(ktProperty: KtProperty, ktDelegate: KtPropertyDelegate, propertyDescriptor: PropertyDescriptor): IrProperty {
|
||||||
|
val ktDelegateExpression = ktDelegate.expression!!
|
||||||
|
val irDelegateInitializer = declarationGenerator.generateInitializerBody(propertyDescriptor, ktDelegateExpression)
|
||||||
|
return DelegatedPropertyGenerator(context).generateDelegatedProperty(ktProperty, ktDelegate, propertyDescriptor, irDelegateInitializer)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateSimpleProperty(ktProperty: KtProperty, propertyDescriptor: PropertyDescriptor): IrProperty {
|
||||||
|
val irProperty = IrPropertyImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.DEFINED, false, propertyDescriptor)
|
||||||
|
|
||||||
|
val irField = if (propertyDescriptor.hasBackingField()) {
|
||||||
|
IrFieldImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, propertyDescriptor,
|
||||||
|
ktProperty.initializer?.let { declarationGenerator.generateInitializerBody(propertyDescriptor, it) })
|
||||||
|
}
|
||||||
|
else null
|
||||||
|
irProperty.backingField = irField
|
||||||
|
|
||||||
|
irProperty.getter = generateGetterIfRequired(ktProperty, propertyDescriptor)
|
||||||
|
|
||||||
|
irProperty.setter = generateSetterIfRequired(ktProperty, propertyDescriptor)
|
||||||
|
|
||||||
|
return irProperty
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun PropertyDescriptor.hasBackingField(): Boolean =
|
||||||
|
get(BindingContext.BACKING_FIELD_REQUIRED, this) ?: false
|
||||||
|
|
||||||
|
private fun generateGetterIfRequired(ktProperty: KtProperty, property: PropertyDescriptor): IrFunction? {
|
||||||
|
val getter = property.getter ?: return null
|
||||||
|
|
||||||
|
val ktGetter = ktProperty.getter
|
||||||
|
if (DescriptorUtils.isInterface(property.containingDeclaration) && ktGetter == null) return null
|
||||||
|
|
||||||
|
val irGetter = ktGetter?.let {
|
||||||
|
IrFunctionImpl(it.startOffset, it.endOffset, IrDeclarationOrigin.DEFINED, getter)
|
||||||
|
} ?: IrFunctionImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR, getter)
|
||||||
|
|
||||||
|
irGetter.body = ktGetter?.bodyExpression?.let {
|
||||||
|
declarationGenerator.generateFunctionBody(getter, it )
|
||||||
|
} ?: generateDefaultGetterBody(ktProperty, getter)
|
||||||
|
|
||||||
|
return irGetter
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateSetterIfRequired(ktProperty: KtProperty, property: PropertyDescriptor): IrFunction? {
|
||||||
|
if (!property.isVar) return null
|
||||||
|
val setter = property.setter ?: return null
|
||||||
|
|
||||||
|
val ktSetter = ktProperty.setter
|
||||||
|
if (DescriptorUtils.isInterface(property.containingDeclaration) && ktSetter == null) return null
|
||||||
|
|
||||||
|
val irSetter = ktSetter?.let {
|
||||||
|
IrFunctionImpl(it.startOffset, it.endOffset, IrDeclarationOrigin.DEFINED, setter)
|
||||||
|
} ?: IrFunctionImpl(ktProperty.startOffset, ktProperty.endOffset, IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR, setter)
|
||||||
|
|
||||||
|
irSetter.body = ktSetter?.bodyExpression?.let {
|
||||||
|
declarationGenerator.generateFunctionBody(setter, it )
|
||||||
|
} ?: generateDefaultSetterBody(ktProperty, setter)
|
||||||
|
|
||||||
|
return irSetter
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateDefaultGetterBody(ktProperty: KtElement, getter: PropertyGetterDescriptor): IrBlockBody {
|
||||||
|
val property = getter.correspondingProperty
|
||||||
|
|
||||||
|
val irBody = IrBlockBodyImpl(ktProperty.startOffset, ktProperty.endOffset)
|
||||||
|
|
||||||
|
val receiver = generateReceiverExpressionForDefaultPropertyAccessor(ktProperty, property)
|
||||||
|
|
||||||
|
irBody.addStatement(IrReturnImpl(ktProperty.startOffset, ktProperty.endOffset, context.builtIns.nothingType, getter,
|
||||||
|
IrGetFieldImpl(ktProperty.startOffset, ktProperty.endOffset, property, receiver)))
|
||||||
|
return irBody
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateDefaultSetterBody(ktProperty: KtElement, setter: PropertySetterDescriptor): IrBlockBody {
|
||||||
|
val property = setter.correspondingProperty
|
||||||
|
|
||||||
|
val irBody = IrBlockBodyImpl(ktProperty.startOffset, ktProperty.endOffset)
|
||||||
|
|
||||||
|
val receiver = generateReceiverExpressionForDefaultPropertyAccessor(ktProperty, property)
|
||||||
|
|
||||||
|
val setterParameter = setter.valueParameters.single()
|
||||||
|
irBody.addStatement(IrSetFieldImpl(ktProperty.startOffset, ktProperty.endOffset, property, receiver,
|
||||||
|
IrGetVariableImpl(ktProperty.startOffset, ktProperty.endOffset, setterParameter)))
|
||||||
|
return irBody
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun generateReceiverExpressionForDefaultPropertyAccessor(ktProperty: KtElement, property: PropertyDescriptor): IrThisReferenceImpl? {
|
||||||
|
val containingDeclaration = property.containingDeclaration
|
||||||
|
val receiver =
|
||||||
|
if (containingDeclaration is ClassDescriptor)
|
||||||
|
IrThisReferenceImpl(ktProperty.startOffset, ktProperty.endOffset, containingDeclaration.defaultType,
|
||||||
|
containingDeclaration)
|
||||||
|
else
|
||||||
|
null
|
||||||
|
return receiver
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getPropertyDescriptor(ktProperty: KtProperty): PropertyDescriptor {
|
||||||
|
val variableDescriptor = getOrFail(BindingContext.VARIABLE, ktProperty)
|
||||||
|
val propertyDescriptor = variableDescriptor as? PropertyDescriptor ?: TODO("not a property?")
|
||||||
|
return propertyDescriptor
|
||||||
|
}
|
||||||
|
}
|
||||||
+10
@@ -8,10 +8,20 @@ FILE /argumentReorderingInDelegatingConstructorCall.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Base' type=Base
|
||||||
PROPERTY public final val y: kotlin.Int
|
PROPERTY public final val y: kotlin.Int
|
||||||
FIELD public final val y: kotlin.Int
|
FIELD public final val y: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-y>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-y>(): Int'
|
||||||
|
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Base' type=Base
|
||||||
CLASS CLASS Test1
|
CLASS CLASS Test1
|
||||||
CONSTRUCTOR public constructor Test1(xx: kotlin.Int, yy: kotlin.Int)
|
CONSTRUCTOR public constructor Test1(xx: kotlin.Int, yy: kotlin.Int)
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
@@ -10,10 +10,25 @@ FILE /classMembers.kt
|
|||||||
FIELD public final val y: kotlin.Int
|
FIELD public final val y: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-y>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-y>(): Int'
|
||||||
|
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
PROPERTY public final var z: kotlin.Int
|
PROPERTY public final var z: kotlin.Int
|
||||||
FIELD public final var z: kotlin.Int
|
FIELD public final var z: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter z: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter z: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-z>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-z>(): Int'
|
||||||
|
GET_BACKING_FIELD 'z: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
FUN public final fun <set-z>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'z: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
CONSTRUCTOR public constructor C()
|
CONSTRUCTOR public constructor C()
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'constructor C(Int, Int, Int = ...)'
|
DELEGATING_CONSTRUCTOR_CALL 'constructor C(Int, Int, Int = ...)'
|
||||||
|
|||||||
@@ -8,14 +8,29 @@ FILE /dataClasses.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Test1' type=Test1
|
||||||
PROPERTY public final val y: kotlin.String
|
PROPERTY public final val y: kotlin.String
|
||||||
FIELD public final val y: kotlin.String
|
FIELD public final val y: kotlin.String
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter y: String' type=kotlin.String operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter y: String' type=kotlin.String operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-y>(): kotlin.String
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-y>(): String'
|
||||||
|
GET_BACKING_FIELD 'y: String' type=kotlin.String operator=null
|
||||||
|
receiver: THIS of 'Test1' type=Test1
|
||||||
PROPERTY public final val z: kotlin.Any
|
PROPERTY public final val z: kotlin.Any
|
||||||
FIELD public final val z: kotlin.Any
|
FIELD public final val z: kotlin.Any
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter z: Any' type=kotlin.Any operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter z: Any' type=kotlin.Any operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-z>(): kotlin.Any
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-z>(): Any'
|
||||||
|
GET_BACKING_FIELD 'z: Any' type=kotlin.Any operator=null
|
||||||
|
receiver: THIS of 'Test1' type=Test1
|
||||||
FUN public final operator fun component1(): kotlin.Int
|
FUN public final operator fun component1(): kotlin.Int
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
RETURN type=kotlin.Nothing from='component1(): Int'
|
RETURN type=kotlin.Nothing from='component1(): Int'
|
||||||
|
|||||||
+10
@@ -21,6 +21,11 @@ FILE /enum.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'TestEnum2' type=TestEnum2
|
||||||
ENUM_ENTRY enum entry TEST1
|
ENUM_ENTRY enum entry TEST1
|
||||||
init: ENUM_CONSTRUCTOR_CALL 'constructor TestEnum2(Int)' TEST1
|
init: ENUM_CONSTRUCTOR_CALL 'constructor TestEnum2(Int)' TEST1
|
||||||
x: CONST Int type=kotlin.Int value='1'
|
x: CONST Int type=kotlin.Int value='1'
|
||||||
@@ -64,6 +69,11 @@ FILE /enum.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'TestEnum4' type=TestEnum4
|
||||||
ENUM_ENTRY enum entry TEST1
|
ENUM_ENTRY enum entry TEST1
|
||||||
init: ENUM_CONSTRUCTOR_CALL 'constructor TEST1()' TEST1
|
init: ENUM_CONSTRUCTOR_CALL 'constructor TEST1()' TEST1
|
||||||
class: CLASS ENUM_ENTRY TEST1
|
class: CLASS ENUM_ENTRY TEST1
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ FILE /initBlock.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Test2' type=Test2
|
||||||
ANONYMOUS_INITIALIZER Test2
|
ANONYMOUS_INITIALIZER Test2
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
CALL 'println(): Unit' type=kotlin.Unit operator=null
|
CALL 'println(): Unit' type=kotlin.Unit operator=null
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ FILE /initVal.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'TestInitValFromParameter' type=TestInitValFromParameter
|
||||||
CLASS CLASS TestInitValInClass
|
CLASS CLASS TestInitValInClass
|
||||||
CONSTRUCTOR public constructor TestInitValInClass()
|
CONSTRUCTOR public constructor TestInitValInClass()
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
+10
@@ -8,6 +8,16 @@ FILE /initVar.kt
|
|||||||
FIELD public final var x: kotlin.Int
|
FIELD public final var x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter
|
||||||
|
FUN public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'TestInitVarFromParameter' type=TestInitVarFromParameter
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
CLASS CLASS TestInitVarInClass
|
CLASS CLASS TestInitVarInClass
|
||||||
CONSTRUCTOR public constructor TestInitVarInClass()
|
CONSTRUCTOR public constructor TestInitVarInClass()
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
@@ -8,10 +8,20 @@ FILE /primaryConstructor.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Test1' type=Test1
|
||||||
PROPERTY public final val y: kotlin.Int
|
PROPERTY public final val y: kotlin.Int
|
||||||
FIELD public final val y: kotlin.Int
|
FIELD public final val y: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-y>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-y>(): Int'
|
||||||
|
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Test1' type=Test1
|
||||||
CLASS CLASS Test2
|
CLASS CLASS Test2
|
||||||
CONSTRUCTOR public constructor Test2(x: kotlin.Int, y: kotlin.Int)
|
CONSTRUCTOR public constructor Test2(x: kotlin.Int, y: kotlin.Int)
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -21,6 +31,11 @@ FILE /primaryConstructor.kt
|
|||||||
FIELD public final val y: kotlin.Int
|
FIELD public final val y: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-y>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-y>(): Int'
|
||||||
|
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Test2' type=Test2
|
||||||
PROPERTY public final val x: kotlin.Int
|
PROPERTY public final val x: kotlin.Int
|
||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
@@ -39,6 +54,11 @@ FILE /primaryConstructor.kt
|
|||||||
FIELD public final val y: kotlin.Int
|
FIELD public final val y: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-y>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-y>(): Int'
|
||||||
|
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Test3' type=Test3
|
||||||
PROPERTY public final val x: kotlin.Int
|
PROPERTY public final val x: kotlin.Int
|
||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
FUN public final fun <get-x>(): kotlin.Int
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
|||||||
+10
@@ -23,10 +23,20 @@ FILE /primaryConstructorWithSuperConstructorCall.kt
|
|||||||
FIELD public final val x: kotlin.Int
|
FIELD public final val x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
|
||||||
PROPERTY public final val y: kotlin.Int
|
PROPERTY public final val y: kotlin.Int
|
||||||
FIELD public final val y: kotlin.Int
|
FIELD public final val y: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter y: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-y>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-y>(): Int'
|
||||||
|
GET_BACKING_FIELD 'y: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'TestWithDelegatingConstructor' type=TestWithDelegatingConstructor
|
||||||
CONSTRUCTOR public constructor TestWithDelegatingConstructor(x: kotlin.Int)
|
CONSTRUCTOR public constructor TestWithDelegatingConstructor(x: kotlin.Int)
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
DELEGATING_CONSTRUCTOR_CALL 'constructor TestWithDelegatingConstructor(Int, Int)'
|
DELEGATING_CONSTRUCTOR_CALL 'constructor TestWithDelegatingConstructor(Int, Int)'
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ FILE /sealedClasses.kt
|
|||||||
FIELD public final val number: kotlin.Double
|
FIELD public final val number: kotlin.Double
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter number: Double' type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter number: Double' type=kotlin.Double operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-number>(): kotlin.Double
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-number>(): Double'
|
||||||
|
GET_BACKING_FIELD 'number: Double' type=kotlin.Double operator=null
|
||||||
|
receiver: THIS of 'Const' type=Expr.Const
|
||||||
CLASS CLASS Sum
|
CLASS CLASS Sum
|
||||||
CONSTRUCTOR public constructor Sum(e1: Expr, e2: Expr)
|
CONSTRUCTOR public constructor Sum(e1: Expr, e2: Expr)
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
@@ -22,10 +27,20 @@ FILE /sealedClasses.kt
|
|||||||
FIELD public final val e1: Expr
|
FIELD public final val e1: Expr
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter e1: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter e1: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-e1>(): Expr
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-e1>(): Expr'
|
||||||
|
GET_BACKING_FIELD 'e1: Expr' type=Expr operator=null
|
||||||
|
receiver: THIS of 'Sum' type=Expr.Sum
|
||||||
PROPERTY public final val e2: Expr
|
PROPERTY public final val e2: Expr
|
||||||
FIELD public final val e2: Expr
|
FIELD public final val e2: Expr
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter e2: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter e2: Expr' type=Expr operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-e2>(): Expr
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-e2>(): Expr'
|
||||||
|
GET_BACKING_FIELD 'e2: Expr' type=Expr operator=null
|
||||||
|
receiver: THIS of 'Sum' type=Expr.Sum
|
||||||
CLASS OBJECT NotANumber
|
CLASS OBJECT NotANumber
|
||||||
CONSTRUCTOR private constructor NotANumber()
|
CONSTRUCTOR private constructor NotANumber()
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
|
||||||
|
class C {
|
||||||
|
val test1 = 0
|
||||||
|
|
||||||
|
val test2: Int get() = 0
|
||||||
|
|
||||||
|
var test3 = 0
|
||||||
|
|
||||||
|
var test4 = 1; set(value) {
|
||||||
|
field = value
|
||||||
|
}
|
||||||
|
|
||||||
|
var test5 = 1; private set
|
||||||
|
|
||||||
|
val test6 = 1; get
|
||||||
|
|
||||||
|
val test7 by lazy { 42 }
|
||||||
|
|
||||||
|
var test8 by hashMapOf<String, Int>()
|
||||||
|
}
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
FILE /classLevelProperties.kt
|
||||||
|
CLASS CLASS C
|
||||||
|
CONSTRUCTOR public constructor C()
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='C'
|
||||||
|
PROPERTY public final val test1: kotlin.Int = 0
|
||||||
|
FIELD public final val test1: kotlin.Int = 0
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='0'
|
||||||
|
FUN public final fun <get-test1>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
PROPERTY public final val test2: kotlin.Int
|
||||||
|
FUN public final fun <get-test2>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
|
||||||
|
CONST Int type=kotlin.Int value='0'
|
||||||
|
PROPERTY public final var test3: kotlin.Int
|
||||||
|
FIELD public final var test3: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='0'
|
||||||
|
FUN public final fun <get-test3>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test3>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test3: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
FUN public final fun <set-test3>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public final var test4: kotlin.Int
|
||||||
|
FIELD public final var test4: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='1'
|
||||||
|
FUN public final fun <get-test4>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test4>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test4: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
FUN public final fun <set-test4>(value: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit operator=EQ
|
||||||
|
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public final var test5: kotlin.Int
|
||||||
|
FIELD public final var test5: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='1'
|
||||||
|
FUN public final fun <get-test5>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test5>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test5: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
FUN private final fun <set-test5>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public final val test6: kotlin.Int = 1
|
||||||
|
FIELD public final val test6: kotlin.Int = 1
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='1'
|
||||||
|
FUN public final fun <get-test6>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test6>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test6: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
PROPERTY public final val test7: kotlin.Int
|
||||||
|
FIELD val `test7$delegate`: kotlin.Lazy<kotlin.Int>
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
|
||||||
|
initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA
|
||||||
|
FUN local final fun <anonymous>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<anonymous>(): Int'
|
||||||
|
CONST Int type=kotlin.Int value='42'
|
||||||
|
CALLABLE_REFERENCE '<anonymous>(): Int' type=() -> kotlin.Int operator=LAMBDA
|
||||||
|
FUN public final fun <get-test7>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test7>(): Int'
|
||||||
|
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int operator=null
|
||||||
|
$receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
thisRef: THIS of 'C' type=C
|
||||||
|
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty1<C, kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||||
|
PROPERTY public final var test8: kotlin.Int
|
||||||
|
FIELD val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CALL 'hashMapOf(vararg Pair<String, Int>): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
|
||||||
|
FUN public final fun <get-test8>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
|
||||||
|
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int operator=null
|
||||||
|
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
thisRef: THIS of 'C' type=C
|
||||||
|
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||||
|
FUN public final fun <set-test8>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
|
||||||
|
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit operator=null
|
||||||
|
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
thisRef: THIS of 'C' type=C
|
||||||
|
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty1<C, kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
@@ -25,6 +25,11 @@ FILE /delegatedProperties.kt
|
|||||||
FIELD public final val map: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
|
FIELD public final val map: kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter map: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter map: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-map>(): kotlin.collections.MutableMap<kotlin.String, kotlin.Any>
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-map>(): MutableMap<String, Any>'
|
||||||
|
GET_BACKING_FIELD 'map: MutableMap<String, Any>' type=kotlin.collections.MutableMap<kotlin.String, kotlin.Any> operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
PROPERTY public final val test2: kotlin.Int
|
PROPERTY public final val test2: kotlin.Int
|
||||||
FIELD val `test2$delegate`: kotlin.Lazy<kotlin.Int>
|
FIELD val `test2$delegate`: kotlin.Lazy<kotlin.Int>
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
|
||||||
|
val test1 = 0
|
||||||
|
|
||||||
|
val test2: Int get() = 0
|
||||||
|
|
||||||
|
var test3 = 0
|
||||||
|
|
||||||
|
var test4 = 1; set(value) { field = value }
|
||||||
|
|
||||||
|
var test5 = 1; private set
|
||||||
|
|
||||||
|
val test6 = 1; get
|
||||||
|
|
||||||
|
val test7 by lazy { 42 }
|
||||||
|
|
||||||
|
var test8 by hashMapOf<String, Int>()
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
FILE /packageLevelProperties.kt
|
||||||
|
PROPERTY public val test1: kotlin.Int = 0
|
||||||
|
FIELD public val test1: kotlin.Int = 0
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='0'
|
||||||
|
FUN public fun <get-test1>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public val test2: kotlin.Int
|
||||||
|
FUN public fun <get-test2>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
|
||||||
|
CONST Int type=kotlin.Int value='0'
|
||||||
|
PROPERTY public var test3: kotlin.Int
|
||||||
|
FIELD public var test3: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='0'
|
||||||
|
FUN public fun <get-test3>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test3>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test3: Int' type=kotlin.Int operator=null
|
||||||
|
FUN public fun <set-test3>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'test3: Int' type=kotlin.Unit operator=null
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public var test4: kotlin.Int
|
||||||
|
FIELD public var test4: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='1'
|
||||||
|
FUN public fun <get-test4>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test4>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test4: Int' type=kotlin.Int operator=null
|
||||||
|
FUN public fun <set-test4>(value: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'test4: Int' type=kotlin.Unit operator=EQ
|
||||||
|
value: GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public var test5: kotlin.Int
|
||||||
|
FIELD public var test5: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='1'
|
||||||
|
FUN public fun <get-test5>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test5>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test5: Int' type=kotlin.Int operator=null
|
||||||
|
FUN private fun <set-test5>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'test5: Int' type=kotlin.Unit operator=null
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public val test6: kotlin.Int = 1
|
||||||
|
FIELD public val test6: kotlin.Int = 1
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CONST Int type=kotlin.Int value='1'
|
||||||
|
FUN public fun <get-test6>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test6>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test6: Int' type=kotlin.Int operator=null
|
||||||
|
PROPERTY public val test7: kotlin.Int
|
||||||
|
FIELD val `test7$delegate`: kotlin.Lazy<kotlin.Int>
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CALL 'lazy(() -> Int): Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
|
||||||
|
initializer: BLOCK type=() -> kotlin.Int operator=LAMBDA
|
||||||
|
FUN local final fun <anonymous>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<anonymous>(): Int'
|
||||||
|
CONST Int type=kotlin.Int value='42'
|
||||||
|
CALLABLE_REFERENCE '<anonymous>(): Int' type=() -> kotlin.Int operator=LAMBDA
|
||||||
|
FUN public fun <get-test7>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test7>(): Int'
|
||||||
|
CALL 'getValue(Any?, KProperty<*>) on Lazy<Int>: Int' type=kotlin.Int operator=null
|
||||||
|
$receiver: GET_BACKING_FIELD '`test7$delegate`: Lazy<Int>' type=kotlin.Lazy<kotlin.Int> operator=null
|
||||||
|
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||||
|
property: CALLABLE_REFERENCE 'test7: Int' type=kotlin.reflect.KProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||||
|
PROPERTY public var test8: kotlin.Int
|
||||||
|
FIELD val `test8$delegate`: java.util.HashMap<kotlin.String, kotlin.Int>
|
||||||
|
EXPRESSION_BODY
|
||||||
|
CALL 'hashMapOf(vararg Pair<String, Int>): HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
|
||||||
|
FUN public fun <get-test8>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test8>(): Int'
|
||||||
|
CALL 'getValue(Any?, KProperty<*>) on MutableMap<in String, in Int>: Int' type=kotlin.Int operator=null
|
||||||
|
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
|
||||||
|
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||||
|
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||||
|
FUN public fun <set-test8>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<set-test8>(Int): Unit'
|
||||||
|
CALL 'setValue(Any?, KProperty<*>, Int) on MutableMap<in String, in Int>: Unit' type=kotlin.Unit operator=null
|
||||||
|
$receiver: GET_BACKING_FIELD '`test8$delegate`: HashMap<String, Int>' type=java.util.HashMap<kotlin.String, kotlin.Int> operator=null
|
||||||
|
thisRef: CONST Null type=kotlin.Nothing? value='null'
|
||||||
|
property: CALLABLE_REFERENCE 'test8: Int' type=kotlin.reflect.KMutableProperty0<kotlin.Int> operator=PROPERTY_REFERENCE_FOR_DELEGATE
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
class C(
|
||||||
|
val test1: Int,
|
||||||
|
var test2: Int
|
||||||
|
)
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
FILE /primaryCtorProperties.kt
|
||||||
|
CLASS CLASS C
|
||||||
|
CONSTRUCTOR public constructor C(test1: kotlin.Int, test2: kotlin.Int)
|
||||||
|
BLOCK_BODY
|
||||||
|
DELEGATING_CONSTRUCTOR_CALL 'constructor Any()'
|
||||||
|
INSTANCE_INITIALIZER_CALL classDescriptor='C'
|
||||||
|
PROPERTY public final val test1: kotlin.Int
|
||||||
|
FIELD public final val test1: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
GET_VAR 'value-parameter test1: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-test1>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test1>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test1: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
PROPERTY public final var test2: kotlin.Int
|
||||||
|
FIELD public final var test2: kotlin.Int
|
||||||
|
EXPRESSION_BODY
|
||||||
|
GET_VAR 'value-parameter test2: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-test2>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-test2>(): Int'
|
||||||
|
GET_BACKING_FIELD 'test2: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
FUN public final fun <set-test2>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'test2: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
@@ -20,6 +20,11 @@ FILE /arrayAugmentedAssignment1.kt
|
|||||||
FIELD public final val x: kotlin.IntArray
|
FIELD public final val x: kotlin.IntArray
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: IntArray' type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: IntArray' type=kotlin.IntArray operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.IntArray
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): IntArray'
|
||||||
|
GET_BACKING_FIELD 'x: IntArray' type=kotlin.IntArray operator=null
|
||||||
|
receiver: THIS of 'C' type=C
|
||||||
FUN public fun testVariable(): kotlin.Unit
|
FUN public fun testVariable(): kotlin.Unit
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
VAR var x: kotlin.IntArray
|
VAR var x: kotlin.IntArray
|
||||||
|
|||||||
@@ -8,6 +8,16 @@ FILE /assignments.kt
|
|||||||
FIELD public final var x: kotlin.Int
|
FIELD public final var x: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter x: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-x>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-x>(): Int'
|
||||||
|
GET_BACKING_FIELD 'x: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Ref' type=Ref
|
||||||
|
FUN public final fun <set-x>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'x: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'Ref' type=Ref
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
FUN public fun test1(): kotlin.Unit
|
FUN public fun test1(): kotlin.Unit
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
VAR var x: kotlin.Int
|
VAR var x: kotlin.Int
|
||||||
|
|||||||
@@ -130,6 +130,16 @@ FILE /complexAugmentedAssignment.kt
|
|||||||
FIELD public final var s: kotlin.Int
|
FIELD public final var s: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter s: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter s: Int = ...' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-s>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-s>(): Int'
|
||||||
|
GET_BACKING_FIELD 's: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'B' type=B
|
||||||
|
FUN public final fun <set-s>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 's: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'B' type=B
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
CLASS OBJECT Host
|
CLASS OBJECT Host
|
||||||
CONSTRUCTOR private constructor Host()
|
CONSTRUCTOR private constructor Host()
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
@@ -13,6 +13,16 @@ FILE /forWithImplicitReceivers.kt
|
|||||||
FIELD public final var value: kotlin.Int
|
FIELD public final var value: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-value>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-value>(): Int'
|
||||||
|
GET_BACKING_FIELD 'value: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'IntCell' type=IntCell
|
||||||
|
FUN public final fun <set-value>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'IntCell' type=IntCell
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
CLASS INTERFACE IReceiver
|
CLASS INTERFACE IReceiver
|
||||||
FUN public open operator fun FiveTimes.iterator(): IntCell
|
FUN public open operator fun FiveTimes.iterator(): IntCell
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
@@ -8,6 +8,16 @@ FILE /safeCalls.kt
|
|||||||
FIELD public final var value: kotlin.Int
|
FIELD public final var value: kotlin.Int
|
||||||
EXPRESSION_BODY
|
EXPRESSION_BODY
|
||||||
GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
GET_VAR 'value-parameter value: Int' type=kotlin.Int operator=INITIALIZE_PROPERTY_FROM_PARAMETER
|
||||||
|
FUN public final fun <get-value>(): kotlin.Int
|
||||||
|
BLOCK_BODY
|
||||||
|
RETURN type=kotlin.Nothing from='<get-value>(): Int'
|
||||||
|
GET_BACKING_FIELD 'value: Int' type=kotlin.Int operator=null
|
||||||
|
receiver: THIS of 'Ref' type=Ref
|
||||||
|
FUN public final fun <set-value>(<set-?>: kotlin.Int): kotlin.Unit
|
||||||
|
BLOCK_BODY
|
||||||
|
SET_BACKING_FIELD 'value: Int' type=kotlin.Unit operator=null
|
||||||
|
receiver: THIS of 'Ref' type=Ref
|
||||||
|
value: GET_VAR 'value-parameter <set-?>: Int' type=kotlin.Int operator=null
|
||||||
CLASS INTERFACE IHost
|
CLASS INTERFACE IHost
|
||||||
FUN public open fun kotlin.String.extLength(): kotlin.Int
|
FUN public open fun kotlin.String.extLength(): kotlin.Int
|
||||||
BLOCK_BODY
|
BLOCK_BODY
|
||||||
|
|||||||
@@ -190,6 +190,12 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
|||||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations"), Pattern.compile("^(.+)\\.kt$"), true);
|
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/ir/irText/declarations"), Pattern.compile("^(.+)\\.kt$"), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("classLevelProperties.kt")
|
||||||
|
public void testClassLevelProperties() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/classLevelProperties.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("defaultArguments.kt")
|
@TestMetadata("defaultArguments.kt")
|
||||||
public void testDefaultArguments() throws Exception {
|
public void testDefaultArguments() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/defaultArguments.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/defaultArguments.kt");
|
||||||
@@ -214,6 +220,18 @@ public class IrTextTestCaseGenerated extends AbstractIrTextTestCase {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("packageLevelProperties.kt")
|
||||||
|
public void testPackageLevelProperties() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/packageLevelProperties.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
@TestMetadata("primaryCtorProperties.kt")
|
||||||
|
public void testPrimaryCtorProperties() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/primaryCtorProperties.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("typeAlias.kt")
|
@TestMetadata("typeAlias.kt")
|
||||||
public void testTypeAlias() throws Exception {
|
public void testTypeAlias() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/typeAlias.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/ir/irText/declarations/typeAlias.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user