diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConversionScope.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConversionScope.kt new file mode 100644 index 00000000000..2d604c159c0 --- /dev/null +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConversionScope.kt @@ -0,0 +1,92 @@ +/* + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.fir.backend + +import org.jetbrains.kotlin.fir.declarations.FirSimpleFunction +import org.jetbrains.kotlin.fir.expressions.FirReturnExpression +import org.jetbrains.kotlin.ir.declarations.* + +class Fir2IrConversionScope { + private val parentStack = mutableListOf() + + fun withParent(parent: T, f: T.() -> Unit): T { + if (parent == null) return parent + parentStack += parent + parent.f() + parentStack.removeAt(parentStack.size - 1) + return parent + } + + fun applyParentFromStackTo(declaration: T): T { + declaration.parent = parentStack.last() + return declaration + } + + private val functionStack = mutableListOf() + + fun withFunction(function: T, f: T.() -> Unit): T { + functionStack += function + function.f() + functionStack.removeAt(functionStack.size - 1) + return function + } + + private val propertyStack = mutableListOf() + + fun withProperty(property: IrProperty, f: IrProperty.() -> Unit): IrProperty { + propertyStack += property + property.f() + propertyStack.removeAt(propertyStack.size - 1) + return property + } + + private val classStack = mutableListOf() + + fun withClass(klass: IrClass, f: IrClass.() -> Unit): IrClass { + classStack += klass + klass.f() + classStack.removeAt(classStack.size - 1) + return klass + } + + private val subjectVariableStack = mutableListOf() + + fun withSubject(subject: IrVariable?, f: () -> T): T { + if (subject != null) subjectVariableStack += subject + val result = f() + if (subject != null) subjectVariableStack.removeAt(subjectVariableStack.size - 1) + return result + } + + fun returnTarget(expression: FirReturnExpression): IrFunction { + val firTarget = expression.target.labeledElement + for (potentialTarget in functionStack.asReversed()) { + // TODO: remove comparison by name + if (potentialTarget.name == (firTarget as? FirSimpleFunction)?.name) { + return potentialTarget + } + } + return functionStack.last() + } + + fun parent(): IrDeclarationParent? = parentStack.lastOrNull() + + fun lastDispatchReceiverParameter(): IrValueParameter? { + val dispatchReceiver = functionStack.lastOrNull()?.dispatchReceiverParameter + return if (dispatchReceiver != null) { + // Use the dispatch receiver of the containing function + dispatchReceiver + } else { + val lastClassSymbol = classStack.lastOrNull()?.symbol + // Use the dispatch receiver of the containing class + lastClassSymbol?.owner?.thisReceiver + } + } + + fun lastClass(): IrClass? = classStack.lastOrNull() + + fun lastSubject(): IrVariable = subjectVariableStack.last() +} \ No newline at end of file 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 3314e9e37ee..639ae567c01 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 @@ -484,7 +484,7 @@ class Fir2IrDeclarationStorage( ) } } - if (containingClass != null && !isStatic) { + if (function !is FirAnonymousFunction && containingClass != null && !isStatic) { dispatchReceiverParameter = declareThisReceiverParameter( parent, thisType = containingClass.thisReceiver!!.type, @@ -502,6 +502,9 @@ class Fir2IrDeclarationStorage( shouldLeaveScope: Boolean, parentPropertyReceiverType: FirTypeRef? = null ): T { + if (irParent != null) { + parent = irParent + } descriptor.bind(this) enterScope(descriptor) declareParameters(function, irParent as? IrClass, isStatic, parentPropertyReceiverType) @@ -729,7 +732,7 @@ class Fir2IrDeclarationStorage( fun getIrProperty( property: FirProperty, - irParent: IrDeclarationParent? = null, + irParent: IrDeclarationParent?, origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED ): IrProperty { return propertyCache.getOrPut(property) { @@ -755,6 +758,9 @@ class Fir2IrDeclarationStorage( isFakeOverride = origin == IrDeclarationOrigin.FAKE_OVERRIDE ).apply { descriptor.bind(this) + if (irParent != null) { + parent = irParent + } val type = property.returnTypeRef.toIrType() getter = createIrPropertyAccessor( property.getter, property, this, type, irParent, false, @@ -962,8 +968,9 @@ class Fir2IrDeclarationStorage( fun getIrBackingFieldSymbol(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.referenceField(irProperty.backingField!!.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 6f3734ea814..6c4cb62baf2 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 @@ -75,84 +75,25 @@ class Fir2IrVisitor( it.initBuiltinTypes() } - private fun ModuleDescriptor.findPackageFragmentForFile(file: FirFile): PackageFragmentDescriptor = - getPackage(file.packageFqName).fragments.first() - - private val parentStack = mutableListOf() - - private fun T.withParent(f: T.() -> Unit): T { - parentStack += this - f() - parentStack.removeAt(parentStack.size - 1) - return this - } - - private fun T.setParentByParentStack(): T { - this.parent = parentStack.last() - return this - } - - private val functionStack = mutableListOf() - - private fun T.withFunction(f: T.() -> Unit): T { - functionStack += this - f() - functionStack.removeAt(functionStack.size - 1) - return this - } - - private val propertyStack = mutableListOf() - - private fun IrProperty.withProperty(f: IrProperty.() -> Unit): IrProperty { - propertyStack += this - f() - propertyStack.removeAt(propertyStack.size - 1) - return this - } - - private val classStack = mutableListOf() - - private fun IrClass.withClass(f: IrClass.() -> Unit): IrClass { - classStack += this - f() - classStack.removeAt(classStack.size - 1) - return this - } - - private fun lastDispatchReceiverParameter(): IrValueParameter? { - val dispatchReceiver = functionStack.lastOrNull()?.dispatchReceiverParameter - return if (dispatchReceiver != null) { - // Use the dispatch receiver of the containing function - dispatchReceiver - } else { - val lastClassSymbol = classStack.lastOrNull()?.symbol - // Use the dispatch receiver of the containing class - lastClassSymbol?.owner?.thisReceiver - } - } - - private val subjectVariableStack = mutableListOf() - - private fun IrVariable?.withSubject(f: () -> T): T { - if (this != null) subjectVariableStack += this - val result = f() - if (this != null) subjectVariableStack.removeAt(subjectVariableStack.size - 1) - return result - } - private fun FirTypeRef.toIrType(): IrType = with(typeConverter) { toIrType() } private fun ConeKotlinType.toIrType(): IrType = with(typeConverter) { toIrType() } + private val conversionScope = Fir2IrConversionScope() + + private fun applyParentFromStackTo(declaration: T): T = conversionScope.applyParentFromStackTo(declaration) + override fun visitElement(element: FirElement, data: Any?): IrElement { TODO("Should not be here: ${element.render()}") } override fun visitFile(file: FirFile, data: Any?): IrFile { - return IrFileImpl( - sourceManager.getOrCreateFileEntry(file.psi as KtFile), - moduleDescriptor.findPackageFragmentForFile(file) - ).withParent { + return conversionScope.withParent( + IrFileImpl( + sourceManager.getOrCreateFileEntry(file.psi as KtFile), + moduleDescriptor.getPackage(file.packageFqName).fragments.first() + ) + ) { declarationStorage.registerFile(file, this) file.declarations.forEach { val irDeclaration = it.toIrDeclaration() ?: return@forEach @@ -171,12 +112,12 @@ class Fir2IrVisitor( } override fun visitEnumEntry(enumEntry: FirEnumEntry, data: Any?): IrElement { - val irEnumEntry = declarationStorage.getIrEnumEntry(enumEntry, irParent = parentStack.last() as IrClass) - irEnumEntry.correspondingClass?.withParent { - setClassContent(enumEntry.initializer as FirAnonymousObject) + val irEnumEntry = declarationStorage.getIrEnumEntry(enumEntry, irParent = conversionScope.lastClass()) + conversionScope.withParent(irEnumEntry.correspondingClass) { + this?.setClassContent(enumEntry.initializer as FirAnonymousObject) } //irEnumEntry.initializerExpression = IrEnumConstructorCallImpl() - return irEnumEntry.setParentByParentStack() + return irEnumEntry } private fun FirClass<*>.getPrimaryConstructorIfAny(): FirConstructor? = @@ -199,7 +140,10 @@ class Fir2IrVisitor( originalFunction, declarationStorage.findIrParent(originalFunction), origin = origin ) val baseSymbol = functionSymbol.overriddenSymbol - declarations += irFunction.setParentByParentStack().withFunction { + // In fake overrides, parent logic is a bit specific, because + // parent of *original* function (base class) is used for dispatch receiver, + // but fake override itself uses parent from its containing (derived) class + declarations += conversionScope.withFunction(applyParentFromStackTo(irFunction)) { setFunctionContent(irFunction.descriptor, originalFunction, firOverriddenSymbol = baseSymbol) } } else if (fakeOverrideMode != FakeOverrideMode.SUBSTITUTION && originalFunction.visibility != Visibilities.PRIVATE) { @@ -211,7 +155,7 @@ class Fir2IrVisitor( val irFunction = declarationStorage.getIrFunction( fakeOverrideFunction, declarationStorage.findIrParent(originalFunction), origin = origin ) - declarations += irFunction.setParentByParentStack().withFunction { + declarations += conversionScope.withFunction(applyParentFromStackTo(irFunction)) { setFunctionContent(irFunction.descriptor, fakeOverrideFunction, firOverriddenSymbol = functionSymbol) } } @@ -227,7 +171,7 @@ class Fir2IrVisitor( originalProperty, declarationStorage.findIrParent(originalProperty), origin = origin ) val baseSymbol = propertySymbol.overriddenSymbol - declarations += irProperty.setParentByParentStack().withProperty { + declarations += conversionScope.withProperty(applyParentFromStackTo(irProperty)) { setPropertyContent(irProperty.descriptor, originalProperty, firOverriddenSymbol = baseSymbol) } } else if (fakeOverrideMode != FakeOverrideMode.SUBSTITUTION && originalProperty.visibility != Visibilities.PRIVATE) { @@ -239,7 +183,7 @@ class Fir2IrVisitor( val irProperty = declarationStorage.getIrProperty( fakeOverrideProperty, declarationStorage.findIrParent(originalProperty), origin = origin ) - declarations += irProperty.setParentByParentStack().withProperty { + declarations += conversionScope.withProperty(applyParentFromStackTo(irProperty)) { setPropertyContent(irProperty.descriptor, fakeOverrideProperty, firOverriddenSymbol = propertySymbol) } } @@ -250,9 +194,9 @@ class Fir2IrVisitor( private fun IrClass.setClassContent(klass: FirClass<*>) { declarationStorage.enterScope(descriptor) - val primaryConstructor = klass.getPrimaryConstructorIfAny() - val irPrimaryConstructor = primaryConstructor?.accept(this@Fir2IrVisitor, null) as IrConstructor? - withClass { + conversionScope.withClass(this) { + val primaryConstructor = klass.getPrimaryConstructorIfAny() + val irPrimaryConstructor = primaryConstructor?.accept(this@Fir2IrVisitor, null) as IrConstructor? if (irPrimaryConstructor != null) { declarations += irPrimaryConstructor } @@ -271,19 +215,19 @@ class Fir2IrVisitor( annotations = klass.annotations.mapNotNull { it.accept(this@Fir2IrVisitor, null) as? IrConstructorCall } - } - if (irPrimaryConstructor != null) { - declarationStorage.leaveScope(irPrimaryConstructor.descriptor) + if (irPrimaryConstructor != null) { + declarationStorage.leaveScope(irPrimaryConstructor.descriptor) + } } declarationStorage.leaveScope(descriptor) } override fun visitRegularClass(regularClass: FirRegularClass, data: Any?): IrElement { - return declarationStorage.getIrClass(regularClass, setParentAndContent = false) - .setParentByParentStack() - .withParent { - setClassContent(regularClass) - } + return conversionScope.withParent( + applyParentFromStackTo(declarationStorage.getIrClass(regularClass, setParentAndContent = false)) + ) { + setClassContent(regularClass) + } } private fun IrFunction.addDispatchReceiverParameter(containingClass: IrClass) { @@ -294,11 +238,13 @@ class Fir2IrVisitor( startOffset, endOffset, thisOrigin, descriptor, thisType ) { symbol -> - IrValueParameterImpl( - startOffset, endOffset, thisOrigin, symbol, - Name.special(""), -1, thisType, - varargElementType = null, isCrossinline = false, isNoinline = false - ).setParentByParentStack() + conversionScope.applyParentFromStackTo( + IrValueParameterImpl( + startOffset, endOffset, thisOrigin, symbol, + Name.special(""), -1, thisType, + varargElementType = null, isCrossinline = false, isNoinline = false + ) + ) }.also { descriptor.bind(it) } } @@ -307,10 +253,9 @@ class Fir2IrVisitor( firFunction: FirFunction<*>?, firOverriddenSymbol: FirNamedFunctionSymbol? = null ): T { - setParentByParentStack() - withParent { + conversionScope.withParent(this) { val firFunctionSymbol = (firFunction as? FirSimpleFunction)?.symbol - val lastClass = classStack.lastOrNull() + val lastClass = conversionScope.lastClass() val containingClass = if (firOverriddenSymbol == null || firFunctionSymbol == null) { lastClass } else { @@ -328,7 +273,7 @@ class Fir2IrVisitor( } } } - if (firFunction !is FirConstructor && containingClass != null) { + if (firFunction !is FirConstructor && firFunction !is FirAnonymousFunction && containingClass != null) { addDispatchReceiverParameter(containingClass) } if (firFunction != null) { @@ -378,21 +323,21 @@ class Fir2IrVisitor( override fun visitConstructor(constructor: FirConstructor, data: Any?): IrElement { val irConstructor = declarationStorage.getIrConstructor( - constructor, irParent = parentStack.last() as? IrClass + constructor, irParent = conversionScope.lastClass() ) - return irConstructor.setParentByParentStack().withFunction { + return conversionScope.withFunction(irConstructor) { setFunctionContent(irConstructor.descriptor, constructor) } } override fun visitAnonymousInitializer(anonymousInitializer: FirAnonymousInitializer, data: Any?): IrElement { val origin = IrDeclarationOrigin.DEFINED - val parent = parentStack.last() as IrClass + val parent = conversionScope.lastClass()!! return anonymousInitializer.convertWithOffsets { startOffset, endOffset -> symbolTable.declareAnonymousInitializer( startOffset, endOffset, origin, parent.descriptor ).apply { - setParentByParentStack() + this.parent = parent declarationStorage.enterScope(descriptor) body = anonymousInitializer.body!!.convertToIrBlockBody() declarationStorage.leaveScope(descriptor) @@ -435,17 +380,17 @@ class Fir2IrVisitor( override fun visitSimpleFunction(simpleFunction: FirSimpleFunction, data: Any?): IrElement { val irFunction = declarationStorage.getIrFunction( - simpleFunction, irParent = parentStack.last() as? IrClass + simpleFunction, irParent = conversionScope.parent() ) - return irFunction.setParentByParentStack().withFunction { + return conversionScope.withFunction(irFunction) { setFunctionContent(irFunction.descriptor, simpleFunction) } } override fun visitAnonymousFunction(anonymousFunction: FirAnonymousFunction, data: Any?): IrElement { return anonymousFunction.convertWithOffsets { startOffset, endOffset -> - val irFunction = declarationStorage.getIrLocalFunction(anonymousFunction) - irFunction.setParentByParentStack().withFunction { + val irFunction = declarationStorage.getIrLocalFunction(anonymousFunction, conversionScope.parent()) + conversionScope.withFunction(irFunction) { setFunctionContent(irFunction.descriptor, anonymousFunction) } @@ -471,7 +416,7 @@ class Fir2IrVisitor( val irVariable = declarationStorage.createAndSaveIrVariable( variable, if (isNextVariable) IrDeclarationOrigin.FOR_LOOP_VARIABLE else null ) - return irVariable.setParentByParentStack().apply { + return applyParentFromStackTo(irVariable).apply { if (initializer != null) { this.initializer = initializer.toIrExpression() } @@ -489,7 +434,7 @@ class Fir2IrVisitor( type: IrType? = null ): IrField { val inferredType = type ?: firInitializerExpression!!.typeRef.toIrType() - return symbolTable.declareField( + val irField = symbolTable.declareField( startOffset, endOffset, origin, descriptor, inferredType ) { symbol -> IrFieldImpl( @@ -499,7 +444,8 @@ class Fir2IrVisitor( isStatic = property.isStatic || parent !is IrClass, isFakeOverride = origin == IrDeclarationOrigin.FAKE_OVERRIDE ) - }.setParentByParentStack().withParent { + } + return conversionScope.withParent(applyParentFromStackTo(irField)) { declarationStorage.enterScope(descriptor) val initializerExpression = firInitializerExpression?.toIrExpression() initializer = initializerExpression?.let { IrExpressionBodyImpl(it) } @@ -566,8 +512,8 @@ class Fir2IrVisitor( override fun visitProperty(property: FirProperty, data: Any?): IrElement { if (property.isLocal) return visitLocalVariable(property) - val irProperty = declarationStorage.getIrProperty(property, irParent = parentStack.last() as? IrClass) - return irProperty.setParentByParentStack().withProperty { setPropertyContent(irProperty.descriptor, property) } + val irProperty = declarationStorage.getIrProperty(property, irParent = conversionScope.parent()) + return conversionScope.withProperty(irProperty) { setPropertyContent(irProperty.descriptor, property) } } private fun IrFieldAccessExpression.setReceiver(declaration: IrDeclaration): IrFieldAccessExpression { @@ -587,15 +533,16 @@ class Fir2IrVisitor( isDefault: Boolean, isFakeOverride: Boolean ) { - withFunction { + conversionScope.withFunction(this) { if (propertyAccessor != null) { with(declarationStorage) { this@setPropertyAccessorContent.enterLocalScope(propertyAccessor) } } else { declarationStorage.enterScope(descriptor) } + applyParentFromStackTo(this) setFunctionContent(descriptor, propertyAccessor) if (isDefault || isFakeOverride) { - withParent { + conversionScope.withParent(this) { declarationStorage.enterScope(descriptor) val backingField = correspondingProperty.backingField val fieldSymbol = symbolTable.referenceField(correspondingProperty.descriptor) @@ -626,15 +573,7 @@ class Fir2IrVisitor( override fun visitReturnExpression(returnExpression: FirReturnExpression, data: Any?): IrElement { - val firTarget = returnExpression.target.labeledElement - var irTarget = functionStack.last() - for (potentialTarget in functionStack.asReversed()) { - // TODO: remove comparison by name - if (potentialTarget.name == (firTarget as? FirSimpleFunction)?.name) { - irTarget = potentialTarget - break - } - } + val irTarget = conversionScope.returnTarget(returnExpression) return returnExpression.convertWithOffsets { startOffset, endOffset -> val result = returnExpression.result val descriptor = irTarget.descriptor @@ -690,7 +629,7 @@ class Fir2IrVisitor( return typeRef.convertWithOffsets { startOffset, endOffset -> if (calleeReference is FirSuperReference) { if (typeRef !is FirComposedSuperTypeRef) { - val dispatchReceiver = lastDispatchReceiverParameter() + val dispatchReceiver = conversionScope.lastDispatchReceiverParameter() if (dispatchReceiver != null) { return@convertWithOffsets IrGetValueImpl(startOffset, endOffset, dispatchReceiver.type, dispatchReceiver.symbol) } @@ -910,14 +849,14 @@ class Fir2IrVisitor( } if (firObject != null) { val irObject = declarationStorage.getIrClass(firObject, setParentAndContent = false) - if (irObject != classStack.lastOrNull()) { + if (irObject != conversionScope.lastClass()) { return thisReceiverExpression.convertWithOffsets { startOffset, endOffset -> IrGetObjectValueImpl(startOffset, endOffset, irObject.defaultType, irObject.symbol) } } } - val dispatchReceiver = lastDispatchReceiverParameter() + val dispatchReceiver = conversionScope.lastDispatchReceiverParameter() if (dispatchReceiver != null) { return thisReceiverExpression.convertWithOffsets { startOffset, endOffset -> IrGetValueImpl(startOffset, endOffset, dispatchReceiver.type, dispatchReceiver.symbol) @@ -1046,7 +985,8 @@ class Fir2IrVisitor( } override fun visitAnonymousObject(anonymousObject: FirAnonymousObject, data: Any?): IrElement { - val anonymousClass = declarationStorage.getIrAnonymousObject(anonymousObject).setParentByParentStack().withParent { + val anonymousClass = declarationStorage.getIrAnonymousObject(anonymousObject) + conversionScope.withParent(applyParentFromStackTo(anonymousClass)) { setClassContent(anonymousObject) } val anonymousClassType = anonymousClass.thisReceiver!!.type @@ -1159,8 +1099,7 @@ class Fir2IrVisitor( return when { subjectVariable != null -> subjectVariable.accept(this, null) as IrVariable subjectExpression != null -> { - val irSubject = declarationStorage.declareTemporaryVariable(subjectExpression.toIrExpression(), "subject") - irSubject.setParentByParentStack() + applyParentFromStackTo(declarationStorage.declareTemporaryVariable(subjectExpression.toIrExpression(), "subject")) } else -> null } @@ -1180,7 +1119,7 @@ class Fir2IrVisitor( is KtUnaryExpression -> IrStatementOrigin.EXCLEXCL else -> null } - return subjectVariable.withSubject { + return conversionScope.withSubject(subjectVariable) { whenExpression.convertWithOffsets { startOffset, endOffset -> val irWhen = IrWhenImpl( startOffset, endOffset, @@ -1215,7 +1154,7 @@ class Fir2IrVisitor( } override fun visitWhenSubjectExpression(whenSubjectExpression: FirWhenSubjectExpression, data: Any?): IrElement { - val lastSubjectVariable = subjectVariableStack.last() + val lastSubjectVariable = conversionScope.lastSubject() return whenSubjectExpression.convertWithOffsets { startOffset, endOffset -> IrGetValueImpl(startOffset, endOffset, lastSubjectVariable.type, lastSubjectVariable.symbol) } @@ -1300,7 +1239,7 @@ class Fir2IrVisitor( override fun visitCatch(catch: FirCatch, data: Any?): IrElement { return catch.convertWithOffsets { startOffset, endOffset -> val catchParameter = declarationStorage.createAndSaveIrVariable(catch.parameter) - IrCatchImpl(startOffset, endOffset, catchParameter.setParentByParentStack()).apply { + IrCatchImpl(startOffset, endOffset, applyParentFromStackTo(catchParameter)).apply { result = catch.block.convertToIrExpressionOrBlock() } } diff --git a/compiler/testData/codegen/box/casts/functions/safeAsFunKBig.kt b/compiler/testData/codegen/box/casts/functions/safeAsFunKBig.kt index 3db54fde03b..7b18e68a598 100644 --- a/compiler/testData/codegen/box/casts/functions/safeAsFunKBig.kt +++ b/compiler/testData/codegen/box/casts/functions/safeAsFunKBig.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS diff --git a/compiler/testData/codegen/box/classes/kt1611.kt b/compiler/testData/codegen/box/classes/kt1611.kt index 35d95cffb56..b04a15ef70e 100644 --- a/compiler/testData/codegen/box/classes/kt1611.kt +++ b/compiler/testData/codegen/box/classes/kt1611.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { return Foo().doBar("OK") } diff --git a/compiler/testData/codegen/box/classes/kt1976.kt b/compiler/testData/codegen/box/classes/kt1976.kt index 836129604bb..7e02add4ef3 100644 --- a/compiler/testData/codegen/box/classes/kt1976.kt +++ b/compiler/testData/codegen/box/classes/kt1976.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { public val f : ()->String = {"OK"} } diff --git a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/properValueCapturedByClosure1.kt b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/properValueCapturedByClosure1.kt index 2f9c315b339..5cc5a863009 100644 --- a/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/properValueCapturedByClosure1.kt +++ b/compiler/testData/codegen/box/closures/captureInSuperConstructorCall/properValueCapturedByClosure1.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class Outer(val fn: (() -> String)?) { companion object { val ok = "Fail: Companion.ok" diff --git a/compiler/testData/codegen/box/extensionFunctions/kt1061.kt b/compiler/testData/codegen/box/extensionFunctions/kt1061.kt index 5d4956ef97c..051768c9c74 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt1061.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt1061.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR //KT-1061 Can't call function defined as a val object X { diff --git a/compiler/testData/codegen/box/extensionFunctions/kt23675.kt b/compiler/testData/codegen/box/extensionFunctions/kt23675.kt index 12584b89487..1837e955ab8 100644 --- a/compiler/testData/codegen/box/extensionFunctions/kt23675.kt +++ b/compiler/testData/codegen/box/extensionFunctions/kt23675.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // KJS_WITH_FULL_RUNTIME diff --git a/compiler/testData/codegen/box/functions/kt1649_1.kt b/compiler/testData/codegen/box/functions/kt1649_1.kt index 86309682d1f..849bf5525ff 100644 --- a/compiler/testData/codegen/box/functions/kt1649_1.kt +++ b/compiler/testData/codegen/box/functions/kt1649_1.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { val method : (() -> Unit)? } diff --git a/compiler/testData/codegen/box/functions/kt1649_2.kt b/compiler/testData/codegen/box/functions/kt1649_2.kt index 2a311ea954f..33f420dc3f9 100644 --- a/compiler/testData/codegen/box/functions/kt1649_2.kt +++ b/compiler/testData/codegen/box/functions/kt1649_2.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { val method : () -> Unit? } diff --git a/compiler/testData/codegen/box/functions/kt785.kt b/compiler/testData/codegen/box/functions/kt785.kt index 179a4d078cb..e3073856d42 100644 --- a/compiler/testData/codegen/box/functions/kt785.kt +++ b/compiler/testData/codegen/box/functions/kt785.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A() { var x : Int = 0 diff --git a/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt b/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt index 4c99b74a8eb..1b64f47c726 100644 --- a/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt +++ b/compiler/testData/codegen/box/inference/integerLiteralTypeInLamdaReturnType.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +NewInference -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/inlineClasses/mapInlineClassesWithSuppressWildcardsMode.kt b/compiler/testData/codegen/box/inlineClasses/mapInlineClassesWithSuppressWildcardsMode.kt index b00179c3cd8..c9462d97687 100644 --- a/compiler/testData/codegen/box/inlineClasses/mapInlineClassesWithSuppressWildcardsMode.kt +++ b/compiler/testData/codegen/box/inlineClasses/mapInlineClassesWithSuppressWildcardsMode.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // WITH_RUNTIME // TARGET_BACKEND: JVM diff --git a/compiler/testData/codegen/box/innerNested/createdNestedInOuterMember.kt b/compiler/testData/codegen/box/innerNested/createdNestedInOuterMember.kt index 4b96bbc71ea..f4c0640c7ab 100644 --- a/compiler/testData/codegen/box/innerNested/createdNestedInOuterMember.kt +++ b/compiler/testData/codegen/box/innerNested/createdNestedInOuterMember.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun foo(f: (Int) -> Int) = f(0) class Outer { diff --git a/compiler/testData/codegen/box/jvm8/defaults/inline.kt b/compiler/testData/codegen/box/jvm8/defaults/inline.kt index d8ff9ea2d42..02357f8346a 100644 --- a/compiler/testData/codegen/box/jvm8/defaults/inline.kt +++ b/compiler/testData/codegen/box/jvm8/defaults/inline.kt @@ -1,5 +1,4 @@ // !JVM_DEFAULT_MODE: enable -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // JVM_TARGET: 1.8 // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/accessFromInlineLambda.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/accessFromInlineLambda.kt index c9cfbb185da..e886a66b25e 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/accessFromInlineLambda.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/accessFromInlineLambda.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR // FILE: accessFromInlineLambda.kt import c.C diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/fromInlineLambdaInNestedClass.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/fromInlineLambdaInNestedClass.kt index 2361af88ee7..dfb26e1e54e 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/fromInlineLambdaInNestedClass.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/fromInlineLambdaInNestedClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR // FILE: fromInlineLambdaInNestedClass.kt import b.* diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionAndOwnPrivateCompanion.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionAndOwnPrivateCompanion.kt index 677bc51664a..5ed005eed71 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionAndOwnPrivateCompanion.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionAndOwnPrivateCompanion.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR // FILE: inheritedProtectedCompanionAndOwnPrivateCompanion.kt import b.B diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionsReferencedByName.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionsReferencedByName.kt index 982d08f62d1..d2c927e6d82 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionsReferencedByName.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/inheritedProtectedCompanionsReferencedByName.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR // FILE: twoInheritedProtectedCompanions.kt import c.C diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/lambdaInPropertyInitializer.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/lambdaInPropertyInitializer.kt index 75736d2d435..5adcd688c1d 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/lambdaInPropertyInitializer.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/lambdaInPropertyInitializer.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR // FILE: lambdaInPropertyInitializer.kt import c.C diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/twoInheritedProtectedCompanions.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/twoInheritedProtectedCompanions.kt index 20b6ba5a9eb..599badf5a5a 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/twoInheritedProtectedCompanions.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/multipleCompanionsWithAccessors/twoInheritedProtectedCompanions.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR // FILE: twoInheritedProtectedCompanions.kt import c.C diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromInlineLambdaInNestedClass.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromInlineLambdaInNestedClass.kt index be0a2474191..6495208be53 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromInlineLambdaInNestedClass.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromInlineLambdaInNestedClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR inline fun run(fn: () -> T) = fn() diff --git a/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromLambdaInNestedClass.kt b/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromLambdaInNestedClass.kt index 486e860eec1..661ab5543be 100644 --- a/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromLambdaInNestedClass.kt +++ b/compiler/testData/codegen/box/objects/companionObjectAccess/privateCompanionObjectAccessedFromLambdaInNestedClass.kt @@ -1,5 +1,4 @@ // !LANGUAGE: +ProperVisibilityForCompanionObjectInstanceField -// IGNORE_BACKEND_FIR: JVM_IR class Outer { private companion object { diff --git a/compiler/testData/codegen/box/objects/privateFunctionFromClosureInInitializer_kt5582.kt b/compiler/testData/codegen/box/objects/privateFunctionFromClosureInInitializer_kt5582.kt index 95cdfaa1951..5b71ab435fe 100644 --- a/compiler/testData/codegen/box/objects/privateFunctionFromClosureInInitializer_kt5582.kt +++ b/compiler/testData/codegen/box/objects/privateFunctionFromClosureInInitializer_kt5582.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface T object Foo { diff --git a/compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt b/compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt index 4111dcbeb5f..88cfbb44f32 100644 --- a/compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt +++ b/compiler/testData/codegen/box/objects/selfReferenceToObjectInInlineLambdaInConstructorBody.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR object Test { fun ok() = "OK" val x = run { Test.ok() } diff --git a/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt b/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt index af03a474925..9ac3ac1385f 100644 --- a/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt +++ b/compiler/testData/codegen/box/package/referenceWithTheSameNameAsPackage.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // !LANGUAGE: +NewInference // WITH_RUNTIME diff --git a/compiler/testData/codegen/box/properties/kt1714.kt b/compiler/testData/codegen/box/properties/kt1714.kt index a8b6f686617..1417aec2703 100644 --- a/compiler/testData/codegen/box/properties/kt1714.kt +++ b/compiler/testData/codegen/box/properties/kt1714.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInConstructor.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInConstructor.kt index 57fbd638516..e952222a76a 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInConstructor.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInLocalClassConstructor.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInLocalClassConstructor.kt index 1db7ccb05b3..8fdee638e4f 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInLocalClassConstructor.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInLocalClassConstructor.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunction.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunction.kt index c9d88e43c14..78281274643 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunction.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunction.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInLocalClass.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInLocalClass.kt index 582fedf708e..b323b6c4bca 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInLocalClass.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInLocalClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInNestedClass.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInNestedClass.kt index 4e254519d12..9f41d496659 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInNestedClass.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInMemberFunctionInNestedClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt b/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt index 16a9e969b0c..0e3f71c0fb6 100644 --- a/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt +++ b/compiler/testData/codegen/box/reflection/enclosing/lambdaInObjectDeclaration.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // WITH_REFLECT diff --git a/compiler/testData/codegen/box/secondaryConstructors/defaultParametersNotDuplicated.kt b/compiler/testData/codegen/box/secondaryConstructors/defaultParametersNotDuplicated.kt index c12840e9636..409e42f9ec0 100644 --- a/compiler/testData/codegen/box/secondaryConstructors/defaultParametersNotDuplicated.kt +++ b/compiler/testData/codegen/box/secondaryConstructors/defaultParametersNotDuplicated.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR var global = 0 fun sideEffect() = global++ diff --git a/compiler/testData/codegen/box/secondaryConstructors/delegatedThisWithLambda.kt b/compiler/testData/codegen/box/secondaryConstructors/delegatedThisWithLambda.kt index 9b863f037e6..b48d1356430 100644 --- a/compiler/testData/codegen/box/secondaryConstructors/delegatedThisWithLambda.kt +++ b/compiler/testData/codegen/box/secondaryConstructors/delegatedThisWithLambda.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A(val f: () -> Int) { constructor() : this({ 23 }) } diff --git a/compiler/testData/codegen/box/super/kt4173_3.kt b/compiler/testData/codegen/box/super/kt4173_3.kt index a220dddbed9..8c23cf83f28 100644 --- a/compiler/testData/codegen/box/super/kt4173_3.kt +++ b/compiler/testData/codegen/box/super/kt4173_3.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR open class C(s: Int) { fun test() { diff --git a/compiler/testData/codegen/box/syntheticAccessors/protectedFromLambda.kt b/compiler/testData/codegen/box/syntheticAccessors/protectedFromLambda.kt index 6f26b2e5925..a0cb7165308 100644 --- a/compiler/testData/codegen/box/syntheticAccessors/protectedFromLambda.kt +++ b/compiler/testData/codegen/box/syntheticAccessors/protectedFromLambda.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // FILE: A.kt package first diff --git a/compiler/testData/codegen/box/when/kt5448.kt b/compiler/testData/codegen/box/when/kt5448.kt index 619d300fc35..e7bb0376b21 100644 --- a/compiler/testData/codegen/box/when/kt5448.kt +++ b/compiler/testData/codegen/box/when/kt5448.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/ir/irText/classes/initValInLambda.fir.txt b/compiler/testData/ir/irText/classes/initValInLambda.fir.txt index 631ecf92300..252a279c932 100644 --- a/compiler/testData/ir/irText/classes/initValInLambda.fir.txt +++ b/compiler/testData/ir/irText/classes/initValInLambda.fir.txt @@ -21,12 +21,11 @@ FILE fqName: fileName:/initValInLambda.kt : kotlin.Nothing $receiver: CONST Int type=kotlin.Int value=1 block: FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.TestInitValInLambdaCalledOnce, $receiver:kotlin.Int) returnType:kotlin.Nothing - $this: VALUE_PARAMETER name: type:.TestInitValInLambdaCalledOnce + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Nothing $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:private [final]' type=kotlin.Unit origin=null - receiver: GET_VAR ': .TestInitValInLambdaCalledOnce declared in .TestInitValInLambdaCalledOnce.' type=.TestInitValInLambdaCalledOnce origin=null + receiver: GET_VAR ': .TestInitValInLambdaCalledOnce declared in .TestInitValInLambdaCalledOnce' type=.TestInitValInLambdaCalledOnce origin=null value: CONST Int type=kotlin.Int value=0 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt index 76b5afea5bb..48f10c16af1 100644 --- a/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/classLevelProperties.fir.txt @@ -88,8 +88,7 @@ FILE fqName: fileName:/classLevelProperties.kt CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy origin=null : kotlin.Int initializer: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.C) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.C + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .C.test7$delegate' CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt index 03394432875..ca0a9719693 100644 --- a/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt +++ b/compiler/testData/ir/irText/declarations/delegatedProperties.fir.txt @@ -42,8 +42,7 @@ FILE fqName: fileName:/delegatedProperties.kt CALL 'public final fun lazy (initializer: kotlin.Function0): kotlin.Lazy declared in kotlin' type=kotlin.Lazy origin=null : kotlin.Int initializer: FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.C) returnType:kotlin.Int - $this: VALUE_PARAMETER name: type:.C + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .C.test2$delegate' CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt index 809735933f5..9e089217c12 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryAsReceiver.fir.txt @@ -28,8 +28,7 @@ FILE fqName: fileName:/enumEntryAsReceiver.kt FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.X.B) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.X.B + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.String declared in .X.B.value' CALL 'public final fun (): kotlin.String declared in .X.B' type=kotlin.String origin=GET_PROPERTY diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index 169d077c674..7792edd9ada 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -47,8 +47,7 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.MyEnum.Z + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': . declared in .' type=. origin=null diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.txt index efd53bd1350..0e126219dbb 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.txt @@ -88,14 +88,13 @@ FILE fqName: fileName:/objectReference.kt FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:private [final] EXPRESSION_BODY FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> ($this:.Z) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.Z + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Z declared in .Z.aLambda.' type=.Z origin=null + receiver: GET_VAR ': .Z declared in .Z' type=.Z origin=null value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .Z' type=kotlin.Unit origin=null - $this: GET_VAR ': .Z declared in .Z.aLambda.' type=.Z origin=null + $this: GET_VAR ': .Z declared in .Z' type=.Z origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:private' type=kotlin.Unit origin=null receiver: GET_OBJECT 'CLASS OBJECT name:Z modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Z value: CONST Int type=kotlin.Int value=1