From 5386cfe25456ad0a27e2fd19b2d6511833e1b036 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 2 Sep 2019 18:04:56 +0300 Subject: [PATCH] FIR2IR: support fake overridden properties --- .../fir/backend/Fir2IrDeclarationStorage.kt | 119 ++++++++- .../kotlin/fir/backend/Fir2IrVisitor.kt | 246 +++++++++--------- ...rderingInDelegatingConstructorCall.fir.txt | 24 ++ .../ir/irText/classes/classes.fir.txt | 13 +- .../classes/delegatedImplementation.fir.txt | 37 ++- ...structorCallToTypeAliasConstructor.fir.txt | 12 + .../testData/ir/irText/classes/enum.fir.txt | 187 ++++++++++++- .../irText/classes/enumClassModality.fir.txt | 90 +++++++ .../classes/enumWithSecondaryCtor.fir.txt | 73 +++++- .../classesWithAnnotations.fir.txt | 12 + .../delegateFieldWithAnnotations.fir.txt | 2 +- ...edPropertyAccessorsWithAnnotations.fir.txt | 6 +- .../enumEntriesWithAnnotations.fir.txt | 12 + .../enumsInAnnotationArguments.fir.txt | 12 + .../declarations/classLevelProperties.fir.txt | 6 +- .../declarations/delegatedProperties.fir.txt | 12 +- .../multiplatform/expectedEnumClass.fir.txt | 24 ++ .../packageLevelProperties.fir.txt | 6 +- .../parameters/delegatedMembers.fir.txt | 6 + .../differentReceivers.fir.txt | 6 +- .../provideDelegate/member.fir.txt | 4 +- .../provideDelegate/memberExtension.fir.txt | 4 +- .../provideDelegate/topLevel.fir.txt | 4 +- .../callableRefToGenericMember.fir.txt | 2 +- .../irText/expressions/classReference.fir.txt | 4 +- .../irText/expressions/dotQualified.fir.txt | 6 +- .../expressions/enumEntryAsReceiver.fir.txt | 12 + ...umEntryReferenceFromEnumEntryClass.fir.txt | 12 + .../expressions/genericPropertyRef.fir.txt | 8 +- .../expressions/implicitCastToNonNull.fir.txt | 12 +- .../ir/irText/expressions/kt16904.fir.txt | 18 ++ .../ir/irText/expressions/kt30020.fir.txt | 6 + .../expressions/objectAsCallable.fir.txt | 12 + .../expressions/objectClassReference.fir.txt | 2 +- ...nceInClosureInSuperConstructorCall.fir.txt | 6 + .../expressions/propertyReferences.fir.txt | 6 +- .../ir/irText/expressions/safeCalls.fir.txt | 6 +- .../ir/irText/expressions/smartCasts.fir.txt | 6 +- .../temporaryInEnumEntryInitializer.fir.txt | 30 +++ .../expressions/useImportedMember.fir.txt | 6 + .../ir/irText/expressions/values.fir.txt | 12 + .../whenWithSubjectVariable.fir.txt | 3 +- .../ir/irText/lambdas/extensionLambda.fir.txt | 3 +- .../ir/irText/singletons/enumEntry.fir.txt | 12 + .../ir/irText/stubs/builtinMap.fir.txt | 6 +- .../ir/irText/stubs/constFromBuiltins.fir.txt | 3 +- .../genericClassInDifferentModule_m2.fir.txt | 8 +- ...localVariableOfIntersectionType_NI.fir.txt | 21 +- 48 files changed, 950 insertions(+), 189 deletions(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index 16202d53aff..10b30037998 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -11,6 +11,8 @@ import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* +import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertyGetter +import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertySetter import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor import org.jetbrains.kotlin.fir.descriptors.FirPackageFragmentDescriptor import org.jetbrains.kotlin.fir.expressions.FirVariable @@ -32,6 +34,8 @@ import org.jetbrains.kotlin.ir.util.SymbolTable import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.KtFunctionLiteral +import org.jetbrains.kotlin.psi.psiUtil.endOffset +import org.jetbrains.kotlin.psi.psiUtil.startOffsetSkippingComments class Fir2IrDeclarationStorage( private val session: FirSession, @@ -56,6 +60,8 @@ class Fir2IrDeclarationStorage( private val localStorage = Fir2IrLocalStorage() + private val unitType = session.builtinTypes.unitType.toIrType(session, this) + fun enterScope(descriptor: DeclarationDescriptor) { irSymbolTable.enterScope(descriptor) if (descriptor is WrappedSimpleFunctionDescriptor || @@ -229,10 +235,30 @@ class Fir2IrDeclarationStorage( } } - fun T.declareParameters(function: FirFunction<*>, containingClass: IrClass?) { + private fun T.declareDefaultSetterParameter(type: IrType): T { val parent = this - for ((index, valueParameter) in function.valueParameters.withIndex()) { - valueParameters += createAndSaveIrParameter(valueParameter, index).apply { this.parent = parent } + valueParameters += irSymbolTable.declareValueParameter( + startOffset, endOffset, origin, WrappedValueParameterDescriptor(), type + ) { symbol -> + IrValueParameterImpl( + startOffset, endOffset, IrDeclarationOrigin.DEFINED, symbol, + Name.special(""), 0, type, + varargElementType = null, + isCrossinline = false, isNoinline = false + ).apply { this.parent = parent } + } + return this + } + + private fun T.declareParameters(function: FirFunction<*>?, containingClass: IrClass?, isStatic: Boolean) { + val parent = this + if (function is FirDefaultPropertySetter) { + val type = function.valueParameters.first().returnTypeRef.toIrType(session, this@Fir2IrDeclarationStorage) + declareDefaultSetterParameter(type) + } else if (function != null) { + for ((index, valueParameter) in function.valueParameters.withIndex()) { + valueParameters += createAndSaveIrParameter(valueParameter, index).apply { this.parent = parent } + } } if (function !is FirConstructor) { val thisOrigin = IrDeclarationOrigin.DEFINED @@ -258,7 +284,7 @@ class Fir2IrDeclarationStorage( } } } - if (containingClass != null && (function as? FirNamedFunction)?.isStatic != true) { + if (containingClass != null && !isStatic) { val thisType = containingClass.thisReceiver!!.type dispatchReceiverParameter = irSymbolTable.declareValueParameter( startOffset, endOffset, thisOrigin, WrappedReceiverParameterDescriptor(), @@ -275,21 +301,22 @@ class Fir2IrDeclarationStorage( } private fun T.bindAndDeclareParameters( - function: FirFunction<*>, + function: FirFunction<*>?, descriptor: WrappedCallableDescriptor, irParent: IrDeclarationParent?, + isStatic: Boolean, shouldLeaveScope: Boolean ): T { descriptor.bind(this) enterScope(descriptor) - declareParameters(function, containingClass = irParent as? IrClass) + declareParameters(function, containingClass = irParent as? IrClass, isStatic = isStatic) if (shouldLeaveScope) { leaveScope(descriptor) } return this } - private fun T.enterLocalScope(function: FirFunction<*>): T { + fun T.enterLocalScope(function: FirFunction<*>): T { enterScope(descriptor) for ((firParameter, irParameter) in function.valueParameters.zip(valueParameters)) { irSymbolTable.introduceValueParameter(irParameter) @@ -317,7 +344,7 @@ class Fir2IrDeclarationStorage( function.isTailRec, function.isSuspend ) } - }.bindAndDeclareParameters(function, descriptor, irParent, shouldLeaveScope) + }.bindAndDeclareParameters(function, descriptor, irParent, isStatic = function.isStatic, shouldLeaveScope = shouldLeaveScope) } if (function.visibility == Visibilities.LOCAL) { @@ -354,7 +381,7 @@ class Fir2IrDeclarationStorage( isSuspend = false ) }.bindAndDeclareParameters( - function, descriptor, irParent = null, shouldLeaveScope = false + function, descriptor, irParent = null, isStatic = false, shouldLeaveScope = false ) } } @@ -375,18 +402,60 @@ class Fir2IrDeclarationStorage( constructor.name, constructor.visibility, constructor.returnTypeRef.toIrType(session, this), isInline = false, isExternal = false, isPrimary = isPrimary - ).bindAndDeclareParameters(constructor, descriptor, irParent, shouldLeaveScope) + ).bindAndDeclareParameters(constructor, descriptor, irParent, isStatic = true, shouldLeaveScope = shouldLeaveScope) } } } } - fun getIrProperty(property: FirProperty): IrProperty { + private fun createIrPropertyAccessor( + propertyAccessor: FirPropertyAccessor?, + correspondingProperty: IrProperty, + propertyType: IrType, + irParent: IrDeclarationParent?, + isSetter: Boolean, + origin: IrDeclarationOrigin, + startOffset: Int, + endOffset: Int + ): IrSimpleFunction { + val descriptor = WrappedSimpleFunctionDescriptor() + val prefix = if (isSetter) "set" else "get" + return irSymbolTable.declareSimpleFunction( + propertyAccessor?.psi?.startOffsetSkippingComments ?: startOffset, + propertyAccessor?.psi?.endOffset ?: endOffset, + origin, descriptor + ) { symbol -> + val accessorReturnType = if (isSetter) unitType else propertyType + IrFunctionImpl( + startOffset, endOffset, origin, symbol, + Name.special("<$prefix-${correspondingProperty.name}>"), + propertyAccessor?.visibility ?: correspondingProperty.visibility, + correspondingProperty.modality, accessorReturnType, + isInline = false, isExternal = false, isTailrec = false, isSuspend = false + ).apply { + if (propertyAccessor == null && isSetter) { + declareDefaultSetterParameter(propertyType) + } + }.bindAndDeclareParameters( + propertyAccessor, descriptor, irParent, isStatic = irParent !is IrClass, shouldLeaveScope = true + ).apply { + if (irParent != null) { + parent = irParent + } + correspondingPropertySymbol = correspondingProperty.symbol + } + } + } + + fun getIrProperty( + property: FirProperty, + irParent: IrDeclarationParent? = null, + origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED + ): IrProperty { return propertyCache.getOrPut(property) { val containerSource = property.containerSource val descriptor = containerSource?.let { WrappedPropertyDescriptorWithContainerSource(it) } ?: WrappedPropertyDescriptor() - val origin = IrDeclarationOrigin.DEFINED property.convertWithOffsets { startOffset, endOffset -> irSymbolTable.declareProperty( startOffset, endOffset, @@ -401,6 +470,27 @@ class Fir2IrDeclarationStorage( isExternal = false ).apply { descriptor.bind(this) + val type = property.returnTypeRef.toIrType(session, this@Fir2IrDeclarationStorage) + getter = createIrPropertyAccessor( + property.getter, this, type, irParent, false, + when { + property.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR + property.getter is FirDefaultPropertyGetter -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR + else -> origin + }, + startOffset, endOffset + ) + if (property.isVar) { + setter = createIrPropertyAccessor( + property.setter, this, type, irParent, true, + when { + property.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR + property.setter is FirDefaultPropertySetter -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR + else -> origin + }, + startOffset, endOffset + ) + } } } } @@ -529,8 +619,9 @@ class Fir2IrDeclarationStorage( fun getIrPropertyOrFieldSymbol(firVariableSymbol: FirVariableSymbol<*>): IrSymbol { return when (val fir = firVariableSymbol.fir) { is FirProperty -> { - val irProperty = getIrProperty(fir).apply { - setAndModifyParent(findIrParent(fir)) + val irParent = findIrParent(fir) + val irProperty = getIrProperty(fir, irParent).apply { + setAndModifyParent(irParent) } irSymbolTable.referenceProperty(irProperty.descriptor) } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index 54b91716eae..8686aa6fb19 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.fir.backend -import org.jetbrains.kotlin.backend.common.descriptors.WrappedSimpleFunctionDescriptor import org.jetbrains.kotlin.backend.common.descriptors.WrappedValueParameterDescriptor import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.fir.* @@ -28,7 +27,6 @@ import org.jetbrains.kotlin.fir.scopes.impl.FirClassSubstitutionScope import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTagImpl import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.* -import org.jetbrains.kotlin.fir.types.impl.* import org.jetbrains.kotlin.fir.visitors.FirVisitor import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrStatement @@ -36,7 +34,6 @@ import org.jetbrains.kotlin.ir.builders.* import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl import org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl -import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl import org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl import org.jetbrains.kotlin.ir.descriptors.IrBuiltIns import org.jetbrains.kotlin.ir.expressions.* @@ -162,7 +159,7 @@ internal class Fir2IrVisitor( return accept(this@Fir2IrVisitor, null) as IrDeclaration } - private fun FirTypeRef.collectFunctionNamesFromThisAndSupertypes(result: MutableList = mutableListOf()): List { + private fun FirTypeRef.collectCallableNamesFromThisAndSupertypes(result: MutableList = mutableListOf()): List { if (this is FirResolvedTypeRef) { val superType = type if (superType is ConeClassLikeType) { @@ -170,15 +167,15 @@ internal class Fir2IrVisitor( is FirClassSymbol -> { val superClass = superSymbol.fir for (declaration in superClass.declarations) { - if (declaration is FirNamedFunction) { + if (declaration is FirMemberDeclaration && (declaration is FirNamedFunction || declaration is FirProperty)) { result += declaration.name } } - superClass.collectFunctionNamesFromSupertypes(result) + superClass.collectCallableNamesFromSupertypes(result) } is FirTypeAliasSymbol -> { val superAlias = superSymbol.fir - superAlias.expandedTypeRef.collectFunctionNamesFromThisAndSupertypes(result) + superAlias.expandedTypeRef.collectCallableNamesFromThisAndSupertypes(result) } } } @@ -186,9 +183,9 @@ internal class Fir2IrVisitor( return result } - private fun FirClass.collectFunctionNamesFromSupertypes(result: MutableList = mutableListOf()): List { + private fun FirClass.collectCallableNamesFromSupertypes(result: MutableList = mutableListOf()): List { for (superTypeRef in superTypeRefs) { - superTypeRef.collectFunctionNamesFromThisAndSupertypes(result) + superTypeRef.collectCallableNamesFromThisAndSupertypes(result) } return result } @@ -196,13 +193,13 @@ internal class Fir2IrVisitor( private fun FirClass.getPrimaryConstructorIfAny(): FirConstructor? = declarations.filterIsInstance().firstOrNull()?.takeIf { it.isPrimary } - private fun IrClass.addFakeOverrides(klass: FirClass, processedFunctionNames: MutableList) { + private fun IrClass.addFakeOverrides(klass: FirClass, processedCallableNames: MutableList) { if (fakeOverrideMode == FakeOverrideMode.NONE) return - val superTypesFunctionNames = klass.collectFunctionNamesFromSupertypes() + val superTypesCallableNames = klass.collectCallableNamesFromSupertypes() val useSiteScope = (klass as? FirRegularClass)?.buildUseSiteScope(session, ScopeSession()) ?: return - for (name in superTypesFunctionNames) { - if (name in processedFunctionNames) continue - processedFunctionNames += name + for (name in superTypesCallableNames) { + if (name in processedCallableNames) continue + processedCallableNames += name useSiteScope.processFunctionsByName(name) { functionSymbol -> // TODO: think about overloaded functions. May be we should process all names. if (functionSymbol is FirNamedFunctionSymbol) { @@ -232,6 +229,34 @@ internal class Fir2IrVisitor( } ProcessorAction.STOP } + useSiteScope.processPropertiesByName(name) { propertySymbol -> + if (propertySymbol is FirPropertySymbol) { + val originalProperty = propertySymbol.fir + val origin = IrDeclarationOrigin.FAKE_OVERRIDE + if (propertySymbol.isFakeOverride) { + // Substitution case + val irProperty = declarationStorage.getIrProperty( + originalProperty, declarationStorage.findIrParent(originalProperty), origin = origin + ) + val baseSymbol = propertySymbol.overriddenSymbol + declarations += irProperty.setParentByParentStack().withProperty { + setPropertyContent(irProperty.descriptor, originalProperty, firOverriddenSymbol = baseSymbol) + } + } else if (fakeOverrideMode != FakeOverrideMode.SUBSTITUTION) { + // Trivial fake override case + val fakeOverrideSymbol = FirClassSubstitutionScope.createFakeOverrideProperty(session, originalProperty, propertySymbol) + val fakeOverrideProperty = fakeOverrideSymbol.fir + + val irProperty = declarationStorage.getIrProperty( + fakeOverrideProperty, declarationStorage.findIrParent(originalProperty), origin = origin + ) + declarations += irProperty.setParentByParentStack().withProperty { + setPropertyContent(irProperty.descriptor, fakeOverrideProperty, firOverriddenSymbol = propertySymbol) + } + } + } + ProcessorAction.STOP + } } } @@ -243,17 +268,17 @@ internal class Fir2IrVisitor( if (irPrimaryConstructor != null) { declarations += irPrimaryConstructor } - val processedFunctionNames = mutableListOf() + val processedCallableNames = mutableListOf() klass.declarations.forEach { if (it !is FirConstructor || !it.isPrimary) { val irDeclaration = it.toIrDeclaration() ?: return@forEach declarations += irDeclaration - if (it is FirNamedFunction) { - processedFunctionNames += it.name + if (it is FirMemberDeclaration && (it is FirNamedFunction || it is FirProperty)) { + processedCallableNames += it.name } } } - addFakeOverrides(klass, processedFunctionNames) + addFakeOverrides(klass, processedCallableNames) klass.annotations.forEach { val irCall = it.accept(this@Fir2IrVisitor, null) as? IrConstructorCall ?: return@forEach annotations += irCall @@ -273,9 +298,24 @@ internal class Fir2IrVisitor( } } + private fun IrFunction.addDispatchReceiverParameter(containingClass: IrClass) { + val thisOrigin = IrDeclarationOrigin.DEFINED + val thisType = containingClass.thisReceiver!!.type + dispatchReceiverParameter = symbolTable.declareValueParameter( + startOffset, endOffset, thisOrigin, WrappedValueParameterDescriptor(), + thisType + ) { symbol -> + IrValueParameterImpl( + startOffset, endOffset, thisOrigin, symbol, + Name.special(""), -1, thisType, + varargElementType = null, isCrossinline = false, isNoinline = false + ).setParentByParentStack() + } + } + private fun T.setFunctionContent( descriptor: FunctionDescriptor, - firFunction: FirFunction<*>, + firFunction: FirFunction<*>?, firOverriddenSymbol: FirNamedFunctionSymbol? = null ): T { setParentByParentStack() @@ -305,21 +345,12 @@ internal class Fir2IrVisitor( } } if (firFunction !is FirConstructor && containingClass != null) { - val thisOrigin = IrDeclarationOrigin.DEFINED - val thisType = containingClass.thisReceiver!!.type - dispatchReceiverParameter = symbolTable.declareValueParameter( - startOffset, endOffset, thisOrigin, WrappedValueParameterDescriptor(), - thisType - ) { symbol -> - IrValueParameterImpl( - startOffset, endOffset, thisOrigin, symbol, - Name.special(""), -1, thisType, - varargElementType = null, isCrossinline = false, isNoinline = false - ).setParentByParentStack() - } + addDispatchReceiverParameter(containingClass) } - for ((valueParameter, firValueParameter) in valueParameters.zip(firFunction.valueParameters)) { - valueParameter.setDefaultValue(firValueParameter) + if (firFunction != null) { + for ((valueParameter, firValueParameter) in valueParameters.zip(firFunction.valueParameters)) { + valueParameter.setDefaultValue(firValueParameter) + } } if (firOverriddenSymbol != null && this is IrSimpleFunction && firFunctionSymbol != null) { val overriddenSymbol = declarationStorage.getIrFunctionSymbol(firOverriddenSymbol) @@ -327,7 +358,7 @@ internal class Fir2IrVisitor( overriddenSymbols += overriddenSymbol } } - body = firFunction.body?.convertToIrBlockBody() + body = firFunction?.body?.convertToIrBlockBody() if (this !is IrConstructor) { // Scope for primary constructor should be left after class declaration // Scope for secondary constructor should be left after delegating call @@ -487,19 +518,24 @@ internal class Fir2IrVisitor( } } - private fun IrProperty.setPropertyContent(descriptor: PropertyDescriptor, property: FirProperty): IrProperty { + private fun IrProperty.setPropertyContent( + descriptor: PropertyDescriptor, + property: FirProperty, + firOverriddenSymbol: FirPropertySymbol? = null + ): IrProperty { val initializer = property.initializer val delegate = property.delegate val irParent = this.parent - val type = property.returnTypeRef.toIrType(session, declarationStorage) + val propertyType = property.returnTypeRef.toIrType(session, declarationStorage) // TODO: this checks are very preliminary, FIR resolve should determine backing field presence itself + // TODO (2): backing field should be created inside declaration storage if (property.modality != Modality.ABSTRACT && (irParent !is IrClass || !irParent.isInterface)) { if (initializer != null || property.getter is FirDefaultPropertyGetter || property.isVar && property.setter is FirDefaultPropertySetter ) { backingField = createBackingField( property, IrDeclarationOrigin.PROPERTY_BACKING_FIELD, descriptor, - Visibilities.PRIVATE, property.name, property.isVal, initializer, type + Visibilities.PRIVATE, property.name, property.isVal, initializer, propertyType ) } else if (delegate != null) { backingField = createBackingField( @@ -507,10 +543,28 @@ internal class Fir2IrVisitor( Visibilities.PRIVATE, Name.identifier("${property.name}\$delegate"), true, delegate ) } + val backingField = backingField + if (firOverriddenSymbol != null && backingField != null) { + val overriddenSymbol = declarationStorage.getIrPropertyOrFieldSymbol(firOverriddenSymbol.fir.backingFieldSymbol) + if (overriddenSymbol is IrFieldSymbol) { + backingField.overriddenSymbols += overriddenSymbol + } + } + } + val overriddenProperty = firOverriddenSymbol?.let { declarationStorage.getIrPropertyOrFieldSymbol(it) } as? IrPropertySymbol + getter?.setPropertyAccessorContent( + property.getter, this, propertyType, property.getter is FirDefaultPropertyGetter, property.getter == null + ) + getter?.apply { + overriddenProperty?.owner?.getter?.symbol?.let { overriddenSymbols += it } } - getter = property.getter?.let { convertPropertyAccessor(it, type, delegate != null) } if (property.isVar) { - setter = property.setter?.let { convertPropertyAccessor(it, type, delegate != null) } + setter?.setPropertyAccessorContent( + property.setter, this, propertyType, property.setter is FirDefaultPropertySetter, property.setter == null + ) + setter?.apply { + overriddenProperty?.owner?.setter?.symbol?.let { overriddenSymbols += it } + } } property.annotations.forEach { annotations += it.accept(this@Fir2IrVisitor, null) as IrConstructorCall @@ -519,7 +573,7 @@ internal class Fir2IrVisitor( } override fun visitProperty(property: FirProperty, data: Any?): IrProperty { - val irProperty = declarationStorage.getIrProperty(property) + val irProperty = declarationStorage.getIrProperty(property, irParent = parentStack.last() as? IrClass) return irProperty.setParentByParentStack().withProperty { setPropertyContent(irProperty.descriptor, property) } } @@ -533,90 +587,50 @@ internal class Fir2IrVisitor( return this } - - private fun createPropertyAccessor( - propertyAccessor: FirPropertyAccessor, startOffset: Int, endOffset: Int, - correspondingProperty: IrProperty, isDefault: Boolean, hasDelegate: Boolean, propertyType: IrType - ): IrSimpleFunction { - val origin = when { - isDefault -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR - hasDelegate -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR - else -> IrDeclarationOrigin.DEFINED - } - val isSetter = propertyAccessor.isSetter - val prefix = if (isSetter) "set" else "get" - val descriptor = WrappedSimpleFunctionDescriptor() - return symbolTable.declareSimpleFunction( - startOffset, endOffset, origin, descriptor - ) { symbol -> - val accessorReturnType = propertyAccessor.returnTypeRef.toIrType(session, declarationStorage) - IrFunctionImpl( - startOffset, endOffset, origin, symbol, - Name.special("<$prefix-${correspondingProperty.name}>"), - propertyAccessor.visibility, correspondingProperty.modality, accessorReturnType, - isInline = false, isExternal = false, isTailrec = false, isSuspend = false - ).withFunction { - descriptor.bind(this) + private fun IrFunction.setPropertyAccessorContent( + propertyAccessor: FirPropertyAccessor?, + correspondingProperty: IrProperty, + propertyType: IrType, + isDefault: Boolean, + isFakeOverride: Boolean + ) { + withFunction { + if (propertyAccessor != null) { + with(declarationStorage) { this@setPropertyAccessorContent.enterLocalScope(propertyAccessor) } + } else { declarationStorage.enterScope(descriptor) - if (!isDefault) { - with(declarationStorage) { declareParameters(propertyAccessor, containingClass = null) } - } - setFunctionContent(descriptor, propertyAccessor).apply { - correspondingPropertySymbol = symbolTable.referenceProperty(correspondingProperty.descriptor) - if (isDefault) { - withParent { - declarationStorage.enterScope(descriptor) - val backingField = correspondingProperty.backingField - if (isSetter) { - valueParameters += symbolTable.declareValueParameter( - startOffset, endOffset, origin, WrappedValueParameterDescriptor(), propertyType - ) { symbol -> - IrValueParameterImpl( - startOffset, endOffset, IrDeclarationOrigin.DEFINED, symbol, - Name.special(""), 0, propertyType, - varargElementType = null, - isCrossinline = false, isNoinline = false - ).setParentByParentStack() - } - } - val fieldSymbol = symbolTable.referenceField(correspondingProperty.descriptor) - val declaration = this - if (backingField != null) { - body = IrBlockBodyImpl( - startOffset, endOffset, - listOf( - if (isSetter) { - IrSetFieldImpl(startOffset, endOffset, fieldSymbol, accessorReturnType).apply { - setReceiver(declaration) - value = IrGetValueImpl(startOffset, endOffset, propertyType, valueParameters.first().symbol) - } - } else { - IrReturnImpl( - startOffset, endOffset, nothingType, symbol, - IrGetFieldImpl(startOffset, endOffset, fieldSymbol, propertyType).setReceiver(declaration) - ) - } + } + setFunctionContent(descriptor, propertyAccessor) + if (isDefault || isFakeOverride) { + withParent { + declarationStorage.enterScope(descriptor) + val backingField = correspondingProperty.backingField + val fieldSymbol = symbolTable.referenceField(correspondingProperty.descriptor) + val declaration = this + if (!isFakeOverride && backingField != null) { + body = IrBlockBodyImpl( + startOffset, endOffset, + listOf( + if (isSetter) { + IrSetFieldImpl(startOffset, endOffset, fieldSymbol, unitType).apply { + setReceiver(declaration) + value = IrGetValueImpl(startOffset, endOffset, propertyType, valueParameters.first().symbol) + } + } else { + IrReturnImpl( + startOffset, endOffset, nothingType, symbol, + IrGetFieldImpl(startOffset, endOffset, fieldSymbol, propertyType).setReceiver(declaration) ) - ) - } - declarationStorage.leaveScope(descriptor) - } + } + ) + ) } + declarationStorage.leaveScope(descriptor) } } } } - private fun convertPropertyAccessor(propertyAccessor: FirPropertyAccessor, type: IrType, hasDelegate: Boolean): IrSimpleFunction { - val correspondingProperty = propertyStack.last() - return propertyAccessor.convertWithOffsets { startOffset, endOffset -> - createPropertyAccessor( - propertyAccessor, startOffset, endOffset, correspondingProperty, - isDefault = propertyAccessor is FirDefaultPropertyGetter || propertyAccessor is FirDefaultPropertySetter, - hasDelegate = hasDelegate, propertyType = type - ) - } - } override fun visitReturnExpression(returnExpression: FirReturnExpression, data: Any?): IrElement { val firTarget = returnExpression.target.labeledElement diff --git a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt index 32d862d87e5..ae3e86144cf 100644 --- a/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/classes/argumentReorderingInDelegatingConstructorCall.fir.txt @@ -52,6 +52,18 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt x: GET_VAR 'yy: kotlin.Int declared in .Test1.' type=kotlin.Int origin=null y: GET_VAR 'xx: kotlin.Int declared in .Test1.' type=kotlin.Int origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.Base]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Test1 + PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Test1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -81,6 +93,18 @@ FILE fqName: fileName:/argumentReorderingInDelegatingConstructorCall.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (xx: kotlin.Int, yy: kotlin.Int) declared in .Test2' xx: GET_VAR 'yyy: kotlin.Int declared in .Test2.' type=kotlin.Int origin=null yy: GET_VAR 'xxx: kotlin.Int declared in .Test2.' type=kotlin.Int origin=null + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Test2 + PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .Base + $this: VALUE_PARAMETER name: type:.Test2 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/classes.fir.txt b/compiler/testData/ir/irText/classes/classes.fir.txt index 538b048fc29..5b055251548 100644 --- a/compiler/testData/ir/irText/classes/classes.fir.txt +++ b/compiler/testData/ir/irText/classes/classes.fir.txt @@ -97,4 +97,15 @@ FILE fqName: fileName:/classes.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum - + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnumClass) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnumClass + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnumClass) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnumClass diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt index 8b15b1c5919..145cec692f3 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt @@ -225,4 +225,39 @@ FILE fqName: fileName:/delegatedImplementation.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.String declared in .IOther + $this: VALUE_PARAMETER name: type:.Test2 + PROPERTY FAKE_OVERRIDE name:y visibility:public modality:ABSTRACT [var] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:ABSTRACT [var] + overridden: + public abstract fun (): kotlin.Int declared in .IOther + $this: VALUE_PARAMETER name: type:.Test2 + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:ABSTRACT [var] + overridden: + public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name: index:0 type:kotlin.Int + PROPERTY FAKE_OVERRIDE name:z1 visibility:public modality:ABSTRACT [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:z1 visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.Int declared in .IOther + $this: VALUE_PARAMETER name: type:.Test2 + PROPERTY FAKE_OVERRIDE name:z2 visibility:public modality:ABSTRACT [var] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:z2 visibility:public modality:ABSTRACT [var] + overridden: + public abstract fun (): kotlin.Int declared in .IOther + $this: VALUE_PARAMETER name: type:.Test2 + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY FAKE_OVERRIDE name:z2 visibility:public modality:ABSTRACT [var] + overridden: + public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name: index:0 type:kotlin.Int diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt index 2773bbe92db..27b4af91983 100644 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.txt @@ -39,6 +39,12 @@ FILE fqName: fileName:/delegatingConstructorCallToTypeAliasConstructor.kt : value: CONST String type=kotlin.String value="O" INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell]' + PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [val] + overridden: + public final fun (): T of .Cell declared in .Cell + $this: VALUE_PARAMETER name: type:.C1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -60,6 +66,12 @@ FILE fqName: fileName:/delegatingConstructorCallToTypeAliasConstructor.kt : value: CONST String type=kotlin.String value="K" INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell]' + PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [val] + overridden: + public final fun (): T of .Cell declared in .Cell + $this: VALUE_PARAMETER name: type:.C2 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/enum.fir.txt b/compiler/testData/ir/irText/classes/enum.fir.txt index 60a8df5eac0..75fdf68524e 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.txt @@ -66,6 +66,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum1 CLASS ENUM_CLASS name:TestEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum2 [primary] @@ -92,6 +104,12 @@ FILE fqName: fileName:/enum.kt DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[.TestEnum2]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum2 + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST1 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -114,6 +132,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST1 CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST2 CONSTRUCTOR visibility:public <> () returnType:.TestEnum2.TEST2 [primary] @@ -121,6 +151,12 @@ FILE fqName: fileName:/enum.kt DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' x: CONST Int type=kotlin.Int value=2 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum2]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum2 + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST2 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -143,6 +179,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST2 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST2 CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum2] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum2.TEST3 CONSTRUCTOR visibility:public <> () returnType:.TestEnum2.TEST3 [primary] @@ -150,6 +198,12 @@ FILE fqName: fileName:/enum.kt DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum2' x: CONST Int type=kotlin.Int value=3 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum2]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST3) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum2 + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST3 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -172,6 +226,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST3) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST3 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2.TEST3) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2.TEST3 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -194,6 +260,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum2 CLASS ENUM_CLASS name:TestEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum3 CONSTRUCTOR visibility:private <> () returnType:.TestEnum3 [primary] @@ -249,6 +327,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum3) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum3 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum3) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum3 CLASS ENUM_CLASS name:TestEnum4 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum4 [primary] @@ -280,6 +370,12 @@ FILE fqName: fileName:/enum.kt BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_OBJECT 'CLASS ENUM_ENTRY name:TEST1 modality:FINAL visibility:public superTypes:[.TestEnum4]' type=.TestEnum4 + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -302,6 +398,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST1 CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum4] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum4.TEST2 CONSTRUCTOR visibility:public <> () returnType:.TestEnum4.TEST2 [primary] @@ -329,6 +437,12 @@ FILE fqName: fileName:/enum.kt BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_OBJECT 'CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum4]' type=.TestEnum4 + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum4 + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -351,6 +465,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 FUN name:foo visibility:public modality:ABSTRACT <> ($this:.TestEnum4) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.TestEnum4 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any @@ -375,6 +501,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum4 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum4) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum4 CLASS ENUM_CLASS name:TestEnum5 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestEnum5 [primary] @@ -421,6 +559,12 @@ FILE fqName: fileName:/enum.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST2 modality:FINAL visibility:public superTypes:[.TestEnum5]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5.TEST2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum5 + $this: VALUE_PARAMETER name: type:.TestEnum5.TEST2 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -443,6 +587,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5.TEST2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum5.TEST2 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5.TEST2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum5.TEST2 CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum5] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestEnum5.TEST3 CONSTRUCTOR visibility:public <> () returnType:.TestEnum5.TEST3 [primary] @@ -450,6 +606,12 @@ FILE fqName: fileName:/enum.kt DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestEnum5' x: CONST Int type=kotlin.Int value=0 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:TEST3 modality:FINAL visibility:public superTypes:[.TestEnum5]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5.TEST3) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestEnum5 + $this: VALUE_PARAMETER name: type:.TestEnum5.TEST3 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -472,6 +634,18 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5.TEST3) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum5.TEST3 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5.TEST3) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum5.TEST3 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -494,4 +668,15 @@ FILE fqName: fileName:/enum.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum - + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum5 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum5) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum5 diff --git a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt index 244ac4be490..d1e22d2061e 100644 --- a/compiler/testData/ir/irText/classes/enumClassModality.fir.txt +++ b/compiler/testData/ir/irText/classes/enumClassModality.fir.txt @@ -47,6 +47,18 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum1 CLASS ENUM_CLASS name:TestFinalEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum2 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.TestFinalEnum2 [primary] @@ -73,6 +85,12 @@ FILE fqName: fileName:/enumClassModality.kt DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .TestFinalEnum2' x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:X1 modality:FINAL visibility:public superTypes:[.TestFinalEnum2]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum2.X1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .TestFinalEnum2 + $this: VALUE_PARAMETER name: type:.TestFinalEnum2.X1 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -95,6 +113,18 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum2.X1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum2.X1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum2.X1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum2.X1 FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -117,6 +147,18 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum2 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum2 CLASS ENUM_CLASS name:TestFinalEnum3 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestFinalEnum3 CONSTRUCTOR visibility:private <> () returnType:.TestFinalEnum3 [primary] @@ -168,6 +210,18 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum3) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum3 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestFinalEnum3) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestFinalEnum3 CLASS ENUM_CLASS name:TestOpenEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum1 CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum1 [primary] @@ -217,6 +271,18 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestOpenEnum1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestOpenEnum1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestOpenEnum1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestOpenEnum1 CLASS ENUM_CLASS name:TestOpenEnum2 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestOpenEnum2 CONSTRUCTOR visibility:private <> () returnType:.TestOpenEnum2 [primary] @@ -271,6 +337,18 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestOpenEnum2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestOpenEnum2 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestOpenEnum2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestOpenEnum2 CLASS ENUM_CLASS name:TestAbstractEnum1 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAbstractEnum1 CONSTRUCTOR visibility:private <> () returnType:.TestAbstractEnum1 [primary] @@ -324,6 +402,18 @@ FILE fqName: fileName:/enumClassModality.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestAbstractEnum1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestAbstractEnum1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestAbstractEnum1 CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt index 3a680cb16a9..3c752a93c4c 100644 --- a/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt +++ b/compiler/testData/ir/irText/classes/enumWithSecondaryCtor.fir.txt @@ -63,6 +63,18 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test0) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test0 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test0) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test0 CLASS ENUM_CLASS name:Test1 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test1 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test1 [primary] @@ -108,6 +120,12 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test1' x: CONST Int type=kotlin.Int value=1 INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ONE modality:FINAL visibility:public superTypes:[.Test1]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1.ONE) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .Test1 + $this: VALUE_PARAMETER name: type:.Test1.ONE FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -130,6 +148,18 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1.ONE) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test1.ONE + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1.ONE) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test1.ONE CONSTRUCTOR visibility:private <> () returnType:.Test1 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test1' @@ -156,6 +186,18 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test1 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test1 CLASS ENUM_CLASS name:Test2 modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 CONSTRUCTOR visibility:private <> (x:kotlin.Int) returnType:.Test2 [primary] @@ -211,6 +253,12 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt BLOCK_BODY CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: CONST String type=kotlin.String value="ONE" + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2.ONE) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in .Test2 + $this: VALUE_PARAMETER name: type:.Test2.ONE FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -233,6 +281,18 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2.ONE) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test2.ONE + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2.ONE) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test2.ONE CONSTRUCTOR visibility:private <> () returnType:.Test2 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'private constructor (x: kotlin.Int) [primary] declared in .Test2' @@ -261,4 +321,15 @@ FILE fqName: fileName:/enumWithSecondaryCtor.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum - + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test2 + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test2) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Test2 diff --git a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt index 880bf88b36b..369a8088b68 100644 --- a/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/classesWithAnnotations.fir.txt @@ -157,6 +157,18 @@ FILE fqName: fileName:/classesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum CLASS ANNOTATION_CLASS name:TestAnnotation modality:FINAL visibility:public superTypes:[kotlin.Annotation] annotations: TestAnn(x = 'annotation') diff --git a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt index 1b459496c29..84ed472aa6c 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegateFieldWithAnnotations.fir.txt @@ -32,4 +32,4 @@ FILE fqName: fileName:/delegateFieldWithAnnotations.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of [inline] declared in kotlin' type=kotlin.Int origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt index b1026a086eb..068014fe229 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt @@ -97,7 +97,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:.Cell visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:.Cell visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] annotations: A(x = 'test2.get') @@ -114,7 +114,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int @@ -122,5 +122,5 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any?, newValue: kotlin.Int): kotlin.Unit declared in .Cell' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' type=.Cell origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:test2$delegate type:.Cell visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null newValue: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt index 011eeb9b6d8..711c3d91e22 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumEntriesWithAnnotations.fir.txt @@ -109,3 +109,15 @@ FILE fqName: fileName:/enumEntriesWithAnnotations.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.TestEnum) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.TestEnum diff --git a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt index 9d4162c943f..e42c4d02b35 100644 --- a/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/enumsInAnnotationArguments.fir.txt @@ -104,6 +104,18 @@ FILE fqName: fileName:/enumsInAnnotationArguments.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En CLASS ANNOTATION_CLASS name:TestAnn modality:FINAL visibility:public superTypes:[kotlin.Annotation] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn CONSTRUCTOR visibility:public <> (x:.En) returnType:.TestAnn [primary] diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt index 9c912dbac3a..4fab365d02e 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt @@ -100,7 +100,7 @@ FILE fqName: fileName:/classLevelProperties.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of [inline] declared in kotlin' type=kotlin.Int origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: GET_VAR ': .C declared in .C' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final]' getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final] EXPRESSION_BODY @@ -112,7 +112,7 @@ FILE fqName: fileName:/classLevelProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] $this: VALUE_PARAMETER name: type:.C @@ -120,7 +120,7 @@ FILE fqName: fileName:/classLevelProperties.kt BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt index 95e9a3810a8..5e7fb228427 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt @@ -14,7 +14,7 @@ FILE fqName: fileName:/delegatedProperties.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of [inline] declared in kotlin' type=kotlin.Int origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test1: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test1$delegate type:kotlin.Lazy visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (map:kotlin.collections.MutableMap) returnType:.C [primary] @@ -50,7 +50,7 @@ FILE fqName: fileName:/delegatedProperties.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of [inline] declared in kotlin' type=kotlin.Int origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: GET_VAR ': .C declared in .C' type=.C origin=null - property: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test2: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test2$delegate type:kotlin.Lazy visibility:private [final]' getter='public final fun (): kotlin.Int declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final] EXPRESSION_BODY @@ -62,7 +62,7 @@ FILE fqName: fileName:/delegatedProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .C' ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C, :IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [delegated,var] $this: VALUE_PARAMETER name: type:.C @@ -70,7 +70,7 @@ FILE fqName: fileName:/delegatedProperties.kt BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .C declared in .C' type=.C origin=null - PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test3: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test3$delegate type:kotlin.collections.MutableMap visibility:private [final]' getter='public final fun (): IrErrorType declared in .C' setter='public final fun (: IrErrorType): kotlin.Unit declared in .C' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .C.' type=IrErrorType origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: @@ -95,12 +95,12 @@ FILE fqName: fileName:/delegatedProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test4: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test4$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt index 9bf59d88dd4..fd8aefd5b4a 100644 --- a/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt +++ b/compiler/testData/ir/irText/declarations/multiplatform/expectedEnumClass.fir.txt @@ -66,6 +66,18 @@ FILE fqName: fileName:/expectedEnumClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MyEnum) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.MyEnum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MyEnum) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.MyEnum CLASS ENUM_CLASS name:MyEnum modality:FINAL visibility:public superTypes:[kotlin.Enum] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyEnum CONSTRUCTOR visibility:private <> () returnType:.MyEnum [primary] @@ -152,3 +164,15 @@ FILE fqName: fileName:/expectedEnumClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MyEnum) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.MyEnum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MyEnum) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.MyEnum diff --git a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt index 1e64f5bf6c5..16e083aabbb 100644 --- a/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/packageLevelProperties.fir.txt @@ -77,7 +77,7 @@ FILE fqName: fileName:/packageLevelProperties.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.reflect.KProperty<*>): T of [inline] declared in kotlin' type=kotlin.Int origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static]' type=kotlin.Lazy origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final test7: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:test7$delegate type:kotlin.Lazy visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static] EXPRESSION_BODY @@ -88,12 +88,12 @@ FILE fqName: fileName:/packageLevelProperties.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:IrErrorType) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:IrErrorType BLOCK_BODY ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Null type=kotlin.Nothing? value=null - PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final test8: IrErrorType [delegated,var]' field='FIELD DELEGATE name:test8$delegate type:java.util.HashMap visibility:private [final,static]' getter='public final fun (): IrErrorType declared in ' setter='public final fun (: IrErrorType): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null GET_VAR ': IrErrorType declared in .' type=IrErrorType origin=null diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt index 85e3224c614..f89a4bfa21b 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt @@ -40,6 +40,12 @@ FILE fqName: fileName:/delegatedMembers.kt public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in .IBase $this: VALUE_PARAMETER name: type:.IBase VALUE_PARAMETER name:x index:0 type:kotlin.Int + PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:bar visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.Int declared in .IBase + $this: VALUE_PARAMETER name: type:.Test FUN FAKE_OVERRIDE name:qux visibility:public modality:ABSTRACT <> ($this:.IBase, t:TT of .Test, x:X of .IBase.qux) returnType:kotlin.Unit overridden: public abstract fun qux (t: T of .IBase, x: X of .IBase.qux): kotlin.Unit declared in .IBase diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt index 7c25469feca..f4d366ade73 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt @@ -52,7 +52,7 @@ FILE fqName: fileName:/differentReceivers.kt $receiver: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .MyClass' type=.MyClass origin=null value: CONST String type=kotlin.String value="O" host: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field=null getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:testO visibility:public modality:FINAL [delegated,val] BLOCK_BODY @@ -60,7 +60,7 @@ FILE fqName: fileName:/differentReceivers.kt CALL 'public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' type=kotlin.String origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=GET_PROPERTY receiver: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final testO: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testO$delegate type:kotlin.String visibility:private [final,static]' getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:testK visibility:public modality:FINAL [delegated,val] FIELD DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static] EXPRESSION_BODY @@ -72,7 +72,7 @@ FILE fqName: fileName:/differentReceivers.kt CALL 'public final fun getValue (receiver: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' type=kotlin.String origin=null $receiver: GET_FIELD 'FIELD DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static]' type=kotlin.String origin=GET_PROPERTY receiver: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final testK: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final testK: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testK$delegate type:kotlin.String visibility:private [final,static]' getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:testOK visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:testOK type:kotlin.String visibility:private [final,static] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt index 118ec7e3504..bd5d99591c3 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/member.fir.txt @@ -91,7 +91,7 @@ FILE fqName: fileName:/member.kt $this: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null value: CONST String type=kotlin.String value="OK" thisRef: GET_VAR ': .Host declared in .Host' type=.Host origin=null - property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field=null getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.String correspondingProperty: PROPERTY name:testMember visibility:public modality:FINAL [delegated,val] $this: VALUE_PARAMETER name: type:.Host @@ -100,7 +100,7 @@ FILE fqName: fileName:/member.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:testMember$delegate type:.Delegate visibility:private [final]' type=.Delegate origin=GET_PROPERTY thisRef: GET_VAR ': .Host declared in .Host' type=.Host origin=null - property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testMember$delegate type:.Delegate visibility:private [final]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final testMember: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testMember$delegate type:.Delegate visibility:private [final]' getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt index 6237f3dd3f6..9cd762fd241 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -61,7 +61,7 @@ FILE fqName: fileName:/memberExtension.kt CALL 'public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): .Host.StringDelegate declared in .Host' type=.Host.StringDelegate origin=null $this: GET_VAR ': .Host declared in .Host' type=.Host origin=null host: GET_VAR ': .Host declared in .Host' type=.Host origin=null - p: PROPERTY_REFERENCE 'public final plusK: IrErrorType [delegated,val]' field=null getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final plusK: IrErrorType [delegated,val]' field=null getter='public final fun (): IrErrorType declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType correspondingProperty: PROPERTY name:plusK visibility:public modality:FINAL [delegated,val] $this: VALUE_PARAMETER name: type:.Host @@ -69,7 +69,7 @@ FILE fqName: fileName:/memberExtension.kt RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in .Host' ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR ': .Host declared in .Host' type=.Host origin=null - PROPERTY_REFERENCE 'public final plusK: IrErrorType [delegated,val]' field='FIELD DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + PROPERTY_REFERENCE 'public final plusK: IrErrorType [delegated,val]' field='FIELD DELEGATE name:plusK$delegate type:.Host.StringDelegate visibility:private [final]' getter='public final fun (): IrErrorType declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:ok visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:ok type:IrErrorType visibility:private [final] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt index c8c788b3a68..e1e12d9385e 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt @@ -85,7 +85,7 @@ FILE fqName: fileName:/topLevel.kt $this: CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .DelegateProvider' type=.DelegateProvider origin=null value: CONST String type=kotlin.String value="OK" thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field=null getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:testTopLevel visibility:public modality:FINAL [delegated,val] BLOCK_BODY @@ -93,4 +93,4 @@ FILE fqName: fileName:/topLevel.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + property: PROPERTY_REFERENCE 'public final testTopLevel: kotlin.String [delegated,val]' field='FIELD DELEGATE name:testTopLevel$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.String declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null diff --git a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt index 7782fe24b3f..8cc621ade56 100644 --- a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt @@ -45,7 +45,7 @@ FILE fqName: fileName:/callableRefToGenericMember.kt PROPERTY name:test2 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: kotlin.Int [val]' field='FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.Int origin=null + PROPERTY_REFERENCE 'public final bar: kotlin.Int [val]' field=null getter='public final fun (): kotlin.Int declared in .A' setter=null type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/classReference.fir.txt b/compiler/testData/ir/irText/expressions/classReference.fir.txt index c865973c3ea..5a7823be806 100644 --- a/compiler/testData/ir/irText/expressions/classReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/classReference.fir.txt @@ -24,5 +24,5 @@ FILE fqName: fileName:/classReference.kt GET_OBJECT 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_CLASS type=kotlin.reflect.KClass<.A> CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null - ERROR_CALL 'No getter found for R|kotlin/jvm/java|' type=java.lang.Class<.A> - ERROR_CALL 'No getter found for R|kotlin/jvm/java|' type=java.lang.Class<.A> + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=null + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=null diff --git a/compiler/testData/ir/irText/expressions/dotQualified.fir.txt b/compiler/testData/ir/irText/expressions/dotQualified.fir.txt index 5c78594d70f..54148bcbe8b 100644 --- a/compiler/testData/ir/irText/expressions/dotQualified.fir.txt +++ b/compiler/testData/ir/irText/expressions/dotQualified.fir.txt @@ -3,9 +3,11 @@ FILE fqName: fileName:/dotQualified.kt VALUE_PARAMETER name:s index:0 type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun length (s: kotlin.String): kotlin.Int declared in ' - ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int + CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_VAR 's: kotlin.String declared in .length' type=kotlin.String origin=null FUN name:lengthN visibility:public modality:FINAL <> (s:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:s index:0 type:kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun lengthN (s: kotlin.String?): kotlin.Int? declared in ' - ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int? + CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int? origin=null + $this: GET_VAR 's: kotlin.String? declared in .lengthN' type=kotlin.String? origin=null diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index 426e8e90371..6a919e0a07a 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -78,6 +78,18 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.X) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.X + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.X) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.X FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index 858420e586b..478c72a3cb6 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -129,3 +129,15 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MyEnum) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.MyEnum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.MyEnum) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.MyEnum diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt index fdfde941a05..15513f5c8d0 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt @@ -68,7 +68,7 @@ FILE fqName: fileName:/genericPropertyRef.kt FIELD DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field='FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:private' getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.String? origin=null + kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field=null getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.String? origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] BLOCK_BODY @@ -76,12 +76,12 @@ FILE fqName: fileName:/genericPropertyRef.kt CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=GET_PROPERTY t: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] FIELD DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final value: T of .Value [var]' field='FIELD PROPERTY_BACKING_FIELD name:value type:T of .Value visibility:private' getter='public final fun (): T of .Value declared in .Value' setter='public final fun (: T of .Value): kotlin.Unit declared in .Value' type=T of .Value origin=null + kmember: PROPERTY_REFERENCE 'public final value: T of [var]' field=null getter='public final fun (): T of declared in .Value' setter='public final fun (: T of ): kotlin.Unit declared in .Value' type=T of origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] BLOCK_BODY @@ -89,7 +89,7 @@ FILE fqName: fileName:/genericPropertyRef.kt CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int declared in .DVal' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=GET_PROPERTY t: CONST Null type=kotlin.Nothing? value=null - p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal CONSTRUCTOR visibility:public <> (kmember:kotlin.Any) returnType:.DVal [primary] diff --git a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt index 3760f3e9dd0..787f5f5fa4e 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToNonNull.fir.txt @@ -11,7 +11,8 @@ FILE fqName: fileName:/implicitCastToNonNull.kt then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int + then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String origin=null FUN name:test2 visibility:public modality:FINAL (x:T of .test2) returnType:kotlin.Int TYPE_PARAMETER name:T index:0 variance: superTypes:[] VALUE_PARAMETER name:x index:0 type:T of .test2 @@ -25,7 +26,8 @@ FILE fqName: fileName:/implicitCastToNonNull.kt then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: ERROR_CALL 'No getter found for R|kotlin/CharSequence.length|' type=kotlin.Int + then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null + $this: GET_VAR 'x: T of .test2 declared in .test2' type=kotlin.Any origin=null FUN name:test3 visibility:public modality:FINAL (x:kotlin.Any) returnType:kotlin.Int [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[] VALUE_PARAMETER name:x index:0 type:kotlin.Any @@ -38,7 +40,8 @@ FILE fqName: fileName:/implicitCastToNonNull.kt then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: ERROR_CALL 'No getter found for R|kotlin/CharSequence.length|' type=kotlin.Int + then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Any declared in .test3' type=T of .test3 origin=null FUN name:test4 visibility:public modality:FINAL (x:kotlin.Any?) returnType:kotlin.Int [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[] VALUE_PARAMETER name:x index:0 type:kotlin.Any? @@ -51,7 +54,8 @@ FILE fqName: fileName:/implicitCastToNonNull.kt then: CONST Int type=kotlin.Int value=0 BRANCH if: CONST Boolean type=kotlin.Boolean value=true - then: ERROR_CALL 'No getter found for R|kotlin/CharSequence.length|' type=kotlin.Int + then: CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Any? declared in .test4' type=T of .test4 origin=null FUN name:test5 visibility:public modality:FINAL (x:T of .test5, fn:kotlin.Function1.test5, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:T index:0 variance: superTypes:[] TYPE_PARAMETER name:S index:0 variance: superTypes:[] diff --git a/compiler/testData/ir/irText/expressions/kt16904.fir.txt b/compiler/testData/ir/irText/expressions/kt16904.fir.txt index 821c8ce8212..9c374a8f126 100644 --- a/compiler/testData/ir/irText/expressions/kt16904.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt16904.fir.txt @@ -83,6 +83,24 @@ FILE fqName: fileName:/kt16904.kt value: CONST Int type=kotlin.Int value=42 DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.A]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:.B + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): .B declared in .A + $this: VALUE_PARAMETER name: type:.Test1 + PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [var] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [var] + overridden: + public final fun (): kotlin.Int declared in .A + $this: VALUE_PARAMETER name: type:.Test1 + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test1, :kotlin.Int) returnType:kotlin.Unit + correspondingProperty: PROPERTY FAKE_OVERRIDE name:y visibility:public modality:FINAL [var] + overridden: + public final fun (: kotlin.Int): kotlin.Unit declared in .A + $this: VALUE_PARAMETER name: type:.Test1 + VALUE_PARAMETER name: index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.txt index 4d37e41f14d..07e241abcf3 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.txt @@ -197,6 +197,12 @@ FILE fqName: fileName:/kt30020.kt public abstract fun lastIndexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.List $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:element index:0 type:kotlin.Int + PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [val] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.AML) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [val] + overridden: + public abstract fun (): kotlin.Int declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:.AML FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt index e58f7329d38..3bca93519fc 100644 --- a/compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectAsCallable.fir.txt @@ -66,6 +66,18 @@ FILE fqName: fileName:/objectAsCallable.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En FUN name:invoke visibility:public modality:FINAL <> ($receiver:.A, i:kotlin.Int) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.A VALUE_PARAMETER name:i index:0 type:kotlin.Int diff --git a/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt b/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt index b8a98d241f3..47f9e6b2423 100644 --- a/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt @@ -22,4 +22,4 @@ FILE fqName: fileName:/objectClassReference.kt BLOCK_BODY GET_CLASS type=kotlin.reflect.KClass<.A> GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - ERROR_CALL 'No getter found for R|kotlin/jvm/java|' type=java.lang.Class<.A> + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=null diff --git a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt index 6531e72b440..d040a4f2192 100644 --- a/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReferenceInClosureInSuperConstructorCall.fir.txt @@ -40,6 +40,12 @@ FILE fqName: fileName:/objectReferenceInClosureInSuperConstructorCall.kt BLOCK_BODY ERROR_CALL 'Unresolved reference: Test#' type=IrErrorType INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:Test modality:FINAL visibility:public superTypes:[.Base]' + PROPERTY FAKE_OVERRIDE name:lambda visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Test) returnType:kotlin.Function0 + correspondingProperty: PROPERTY FAKE_OVERRIDE name:lambda visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Function0 declared in .Base + $this: VALUE_PARAMETER name: type:.Test FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt index e809f90b8b9..76e9ee5e911 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt @@ -191,7 +191,7 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:delegatedVal$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:delegatedVal$delegate type:.Delegate visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final delegatedVal: kotlin.Int [delegated,val]' field='FIELD DELEGATE name:delegatedVal$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:test_delegatedVal visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_delegatedVal type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY @@ -212,7 +212,7 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any): kotlin.Int declared in .Delegate' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' getter=null setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> (:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:delegatedVar visibility:public modality:FINAL [delegated,var] VALUE_PARAMETER name: index:0 type:kotlin.Int @@ -220,7 +220,7 @@ FILE fqName: fileName:/propertyReferences.kt CALL 'public final fun setValue (thisRef: kotlin.Any?, kProp: kotlin.Any, value: kotlin.Int): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' type=.Delegate origin=GET_PROPERTY thisRef: CONST Null type=kotlin.Nothing? value=null - kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + kProp: PROPERTY_REFERENCE 'public final delegatedVar: kotlin.Int [delegated,var]' field='FIELD DELEGATE name:delegatedVar$delegate type:.Delegate visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter='public final fun (: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KProperty<*> origin=null value: GET_VAR ': kotlin.Int declared in .' type=kotlin.Int origin=null PROPERTY name:test_delegatedVar visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test_delegatedVar type:kotlin.Int visibility:private [final,static] diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt index 76d49f5852e..0071e2a9e8a 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -45,7 +45,8 @@ FILE fqName: fileName:/safeCalls.kt $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun extLength (): kotlin.Int declared in .IHost' - ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int + CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_VAR ': kotlin.String declared in kotlin.String' type=kotlin.String origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -63,7 +64,8 @@ FILE fqName: fileName:/safeCalls.kt VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.String?): kotlin.Int? declared in ' - ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int? + CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int? origin=null + $this: GET_VAR 'x: kotlin.String? declared in .test1' type=kotlin.String? origin=null FUN name:test2 visibility:public modality:FINAL <> (x:kotlin.String?) returnType:kotlin.Int? VALUE_PARAMETER name:x index:0 type:kotlin.String? BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/smartCasts.fir.txt b/compiler/testData/ir/irText/expressions/smartCasts.fir.txt index bbb8f8bd858..d6166c8c12a 100644 --- a/compiler/testData/ir/irText/expressions/smartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/smartCasts.fir.txt @@ -25,11 +25,13 @@ FILE fqName: fileName:/smartCasts.kt then: RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Any): kotlin.Unit declared in ' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null - message: ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int + message: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null CALL 'public final fun expectsString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null CALL 'public final fun expectsInt (i: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null - i: ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int + i: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null CALL 'public final fun expectsString (s: kotlin.String): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: CALL 'public final fun overloaded (s: kotlin.String): kotlin.String declared in ' type=kotlin.String origin=null s: GET_VAR 'x: kotlin.Any declared in .test1' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt index 8775f77f345..8a86b925673 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInEnumEntryInitializer.fir.txt @@ -35,6 +35,12 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt x: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String? origin=null $this: CALL 'public final fun (): kotlin.Any? declared in ' type=kotlin.Any? origin=null INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_ENTRY name:ENTRY modality:FINAL visibility:public superTypes:[.En]' + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En.ENTRY) returnType:kotlin.String? + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String? declared in .En + $this: VALUE_PARAMETER name: type:.En.ENTRY FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -57,6 +63,18 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En.ENTRY) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En.ENTRY + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En.ENTRY) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En.ENTRY FUN FAKE_OVERRIDE name:clone visibility:protected modality:FINAL <> ($this:kotlin.Enum) returnType:kotlin.Any overridden: protected final fun clone (): kotlin.Any declared in kotlin.Enum @@ -79,3 +97,15 @@ FILE fqName: fileName:/temporaryInEnumEntryInitializer.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.En) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.En diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt index 489d0bd13da..3bf5638a1de 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt @@ -118,6 +118,12 @@ FILE fqName: fileName:/useImportedMember.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of declared in .C' GET_VAR ': .C declared in .C' type=.C origin=null + PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C) returnType:T of + correspondingProperty: PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [val] + overridden: + public final fun (): T of declared in .BaseClass + $this: VALUE_PARAMETER name: type:.C FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/values.fir.txt b/compiler/testData/ir/irText/expressions/values.fir.txt index ba0bc4306f0..782aebe60aa 100644 --- a/compiler/testData/ir/irText/expressions/values.fir.txt +++ b/compiler/testData/ir/irText/expressions/values.fir.txt @@ -47,6 +47,18 @@ FILE fqName: fileName:/values.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Enum) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Enum + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Enum) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Enum CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A CONSTRUCTOR visibility:private <> () returnType:.A [primary] diff --git a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt index 83db1c41a44..650fc89d2ee 100644 --- a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt +++ b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt @@ -18,7 +18,8 @@ FILE fqName: fileName:/whenWithSubjectVariable.kt BRANCH if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.String GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null - then: ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int + then: CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.String origin=null BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Int GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt index 59c03fafce6..35fa69ee6d8 100644 --- a/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt +++ b/compiler/testData/ir/irText/lambdas/extensionLambda.fir.txt @@ -8,4 +8,5 @@ FILE fqName: fileName:/extensionLambda.kt FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (it:kotlin.String) returnType:kotlin.Int VALUE_PARAMETER name:it index:0 type:kotlin.String BLOCK_BODY - ERROR_CALL 'No getter found for R|kotlin/String.length|' type=kotlin.Int + CALL 'public open fun (): kotlin.Int declared in kotlin.String' type=kotlin.Int origin=null + $this: GET_VAR ': kotlin.String declared in kotlin.String' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt index 9ae68b6e1c3..7dc5c9a49ec 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt @@ -74,3 +74,15 @@ FILE fqName: fileName:/enumEntry.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Enum $this: VALUE_PARAMETER name: type:kotlin.Enum + PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.String + correspondingProperty: PROPERTY FAKE_OVERRIDE name:name visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.String declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Z + PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Int + correspondingProperty: PROPERTY FAKE_OVERRIDE name:ordinal visibility:public modality:FINAL [val] + overridden: + public final fun (): kotlin.Int declared in kotlin.Enum + $this: VALUE_PARAMETER name: type:.Z diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index eab862aa02f..5fa2ccbdbe5 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -25,5 +25,7 @@ FILE fqName: fileName:/builtinMap.kt BLOCK_BODY CALL 'public open fun put (: K1 of .plus, : V1 of .plus): V1 of .plus declared in java.util.HashMap' type=V1 of .plus origin=null $this: GET_VAR ': java.util.HashMap declared in java.util.HashMap' type=java.util.HashMap<*, *> origin=null - : ERROR_CALL 'No getter found for R|kotlin/Pair.first|' type=K1 of .plus - : ERROR_CALL 'No getter found for R|kotlin/Pair.second|' type=V1 of .plus + : CALL 'public final fun (): K1 of .plus declared in kotlin.Pair' type=K1 of .plus origin=null + $this: GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null + : CALL 'public final fun (): V1 of .plus declared in kotlin.Pair' type=V1 of .plus origin=null + $this: GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null diff --git a/compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt b/compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt index 8dc8cb008db..32f4900c612 100644 --- a/compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt +++ b/compiler/testData/ir/irText/stubs/constFromBuiltins.fir.txt @@ -2,7 +2,8 @@ FILE fqName: fileName:/constFromBuiltins.kt PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:private [final,static] EXPRESSION_BODY - ERROR_CALL 'No getter found for R|kotlin/Int.Companion.MIN_VALUE|' type=kotlin.Int + CALL 'public final fun (): kotlin.Int declared in kotlin.Int.Companion' type=kotlin.Int origin=null + $this: GET_OBJECT 'CLASS CLASS name:Int modality:FINAL visibility:public superTypes:[kotlin.Number; kotlin.Comparable]' type=kotlin.Int.Companion FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt index 18150eb31f4..fc23aba4048 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt @@ -15,7 +15,7 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt VALUE_PARAMETER name:y index:0 type:Y of .Derived1.foo BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' - CALL 'public final fun (): T of .Base declared in .Base' type=T of .Base origin=null + CALL 'public final fun (): T of .Derived1 declared in .Base' type=T of .Derived1 origin=null $this: GET_VAR ': .Base declared in .Base' type=.Base<*> origin=null PROPERTY name:bar visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:private @@ -48,6 +48,12 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt $this: VALUE_PARAMETER name: type:.Derived1 VALUE_PARAMETER name:value index:0 type:T of .Derived1 BLOCK_BODY + PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Derived1) returnType:T of .Derived1 + correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [val] + overridden: + public final fun (): T of .Base declared in .Base + $this: VALUE_PARAMETER name: type:.Derived1 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt index fd5e226c237..271358126ca 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType_NI.fir.txt @@ -95,11 +95,26 @@ FILE fqName: fileName:/localVariableOfIntersectionType_NI.kt VALUE_PARAMETER name:z index:2 type:.Z BLOCK_BODY CALL 'public abstract fun foo (): kotlin.Unit declared in .IA' type=kotlin.Unit origin=null - $this: ERROR_CALL 'No getter found for R|/Inv.t|' type=.IA + $this: CALL 'public abstract fun (): .IA declared in .Inv' type=.IA origin=null + $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=.Inv<.IA> origin=null + : + $this: GET_VAR 'z: .Z declared in .test' type=.Z origin=null + x: GET_VAR 'a: .In<.IA> declared in .test' type=.In<.IA> origin=null + y: GET_VAR 'b: .In<.IB> declared in .test' type=.In<.IB> origin=null CALL 'public abstract fun bar (): kotlin.Unit declared in .IB' type=kotlin.Unit origin=null - $this: ERROR_CALL 'No getter found for R|/Inv.t|' type=.IA + $this: CALL 'public abstract fun (): .IA declared in .Inv' type=.IA origin=null + $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=.Inv<.IA> origin=null + : + $this: GET_VAR 'z: .Z declared in .test' type=.Z origin=null + x: GET_VAR 'a: .In<.IA> declared in .test' type=.In<.IA> origin=null + y: GET_VAR 'b: .In<.IB> declared in .test' type=.In<.IB> origin=null VAR name:t type:.IA [val] - ERROR_CALL 'No getter found for R|/Inv.t|' type=.IA + CALL 'public abstract fun (): .IA declared in .Inv' type=.IA origin=null + $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=.Inv<.IA> origin=null + : + $this: GET_VAR 'z: .Z declared in .test' type=.Z origin=null + x: GET_VAR 'a: .In<.IA> declared in .test' type=.In<.IA> origin=null + y: GET_VAR 'b: .In<.IB> declared in .test' type=.In<.IB> origin=null CALL 'public abstract fun foo (): kotlin.Unit declared in .IA' type=kotlin.Unit origin=null $this: GET_VAR 'val t: .IA [val] declared in .test' type=.IA origin=null CALL 'public abstract fun bar (): kotlin.Unit declared in .IB' type=kotlin.Unit origin=null