From 26974788e9263d8f7b57809478dd4900b46cb4f0 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 14 May 2019 15:58:50 +0300 Subject: [PATCH] FIR2IR converter: handle receivers and parents more correctly --- .../fir/backend/Fir2IrDeclarationStorage.kt | 90 +++++++++++++------ .../kotlin/fir/backend/Fir2IrVisitor.kt | 55 +++++++++--- .../classes/qualifiedSuperCalls.fir.txt | 9 +- .../ir/irText/classes/superCalls.fir.txt | 5 +- .../declarations/constValInitializers.fir.txt | 5 ++ .../parameters/constructor.fir.txt | 1 + .../differentReceivers.fir.txt | 3 +- .../localDifferentReceivers.fir.txt | 3 +- .../provideDelegate/memberExtension.fir.txt | 4 +- .../ir/irText/expressions/arrayAccess.fir.txt | 8 ++ .../expressions/arrayAssignment.fir.txt | 5 ++ .../arrayAugmentedAssignment1.fir.txt | 5 ++ .../expressions/booleanOperators.fir.txt | 40 --------- .../ir/irText/expressions/booleanOperators.kt | 1 + .../boundCallableReferences.fir.txt | 3 +- .../callableRefToGenericMember.fir.txt | 4 +- ...lableReferenceToImportedFromObject.fir.txt | 3 +- .../irText/expressions/coercionToUnit.fir.txt | 3 + .../complexAugmentedAssignment.fir.txt | 12 ++- .../irText/expressions/destructuring1.fir.txt | 5 +- .../destructuringWithUnderscore.fir.txt | 8 +- .../floatingPointCompareTo.fir.txt | 2 + .../floatingPointEquals.fir.txt | 14 +++ .../whenByFloatingPoint.fir.txt | 5 ++ .../ir/irText/expressions/for.fir.txt | 17 +++- .../expressions/forWithBreakContinue.fir.txt | 22 ++++- .../forWithImplicitReceivers.fir.txt | 4 + ...icConstructorCallWithTypeArguments.fir.txt | 1 + .../ir/irText/expressions/ifElseIf.fir.txt | 1 + .../testData/ir/irText/expressions/in.fir.txt | 11 ++- .../expressions/incrementDecrement.fir.txt | 16 ++++ .../jvmStaticFieldReference.fir.txt | 5 ++ .../ir/irText/expressions/kt28456.fir.txt | 1 + .../ir/irText/expressions/kt28456b.fir.txt | 1 + .../ir/irText/expressions/kt30020.fir.txt | 46 +++++----- .../ir/irText/expressions/lambdaInCAO.fir.txt | 1 + .../ir/irText/expressions/literals.fir.txt | 12 ++- .../membersImportedFromObject.fir.txt | 6 +- .../expressions/objectReference.fir.txt | 14 ++- .../primitivesImplicitConversions.fir.txt | 23 +++-- .../expressions/propertyReferences.fir.txt | 6 +- .../safeCallWithIncrementDecrement.fir.txt | 1 + .../expressions/sam/samOperators.fir.txt | 4 + .../expressions/simpleOperators.fir.txt | 11 +++ .../expressions/simpleUnaryOperators.fir.txt | 17 ++-- .../ir/irText/expressions/stringPlus.fir.txt | 11 +++ .../thisReferenceBeforeClassDeclared.fir.txt | 1 + .../expressions/useImportedMember.fir.txt | 4 + .../whenWithSubjectVariable.fir.txt | 8 +- .../irText/regressions/coercionInLoop.fir.txt | 6 +- .../ir/irText/stubs/builtinMap.fir.txt | 1 + .../ir/irText/stubs/javaMethod.fir.txt | 7 -- .../testData/ir/irText/stubs/javaMethod.kt | 1 + .../ir/irText/stubs/javaNestedClass.fir.txt | 7 -- .../ir/irText/stubs/javaNestedClass.kt | 1 + .../ir/irText/stubs/kotlinInnerClass.fir.txt | 7 -- .../ir/irText/stubs/kotlinInnerClass.kt | 1 + .../testData/ir/irText/stubs/simple.fir.txt | 1 + .../localVariableOfIntersectionType.fir.txt | 5 ++ 59 files changed, 400 insertions(+), 174 deletions(-) delete mode 100644 compiler/testData/ir/irText/expressions/booleanOperators.fir.txt delete mode 100644 compiler/testData/ir/irText/stubs/javaMethod.fir.txt delete mode 100644 compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt delete mode 100644 compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt 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 dae6c41b0da..1b24489db36 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 @@ -83,7 +83,7 @@ class Fir2IrDeclarationStorage( val thisType = IrSimpleTypeImpl(symbol, false, emptyList(), emptyList()) val parent = this thisReceiver = irSymbolTable.declareValueParameter( - startOffset, endOffset, thisOrigin, WrappedValueParameterDescriptor(), thisType + startOffset, endOffset, thisOrigin, WrappedReceiverParameterDescriptor(), thisType ) { symbol -> IrValueParameterImpl( startOffset, endOffset, thisOrigin, symbol, @@ -177,45 +177,65 @@ class Fir2IrDeclarationStorage( } } - private fun IrDeclaration.setParentByOwnFir(firMember: FirCallableMemberDeclaration) { - val firBasedSymbol = firMember.symbol + internal fun findIrParent(callableMemberDeclaration: FirCallableMemberDeclaration): IrDeclarationParent? { + val firBasedSymbol = callableMemberDeclaration.symbol val callableId = firBasedSymbol.callableId val parentClassId = callableId.classId - if (parentClassId != null) { + return if (parentClassId != null) { val parentFirSymbol = firSymbolProvider.getClassLikeSymbolByFqName(parentClassId) if (parentFirSymbol is FirClassSymbol) { val parentIrSymbol = getIrClassSymbol(parentFirSymbol) - val parentIrClass = parentIrSymbol.owner - parent = parentIrClass - // TODO: parentIrClass.declarations += this (probably needed for external stuff) + parentIrSymbol.owner + } else { + null } } else { val packageFqName = callableId.packageName - val parentIrPackageFragment = getIrExternalPackageFragment(packageFqName) - parent = parentIrPackageFragment - parentIrPackageFragment.declarations += this + getIrExternalPackageFragment(packageFqName) } } - fun T.declareParameters(function: FirFunction) { + private fun IrDeclaration.setAndModifyParent(irParent: IrDeclarationParent?) { + if (irParent != null) { + parent = irParent + if (irParent is IrExternalPackageFragment) { + irParent.declarations += this + } else if (irParent is IrClass) { + // TODO: irParent.declarations += this (probably needed for external stuff) + } + } + } + + fun T.declareParameters(function: FirFunction, containingClass: IrClass?) { val parent = this for ((index, valueParameter) in function.valueParameters.withIndex()) { valueParameters += createAndSaveIrParameter(valueParameter, index).apply { this.parent = parent } } + if (function !is FirConstructor && containingClass != null && (function as? FirNamedFunction)?.isStatic != true) { + val thisOrigin = IrDeclarationOrigin.DEFINED + val thisType = containingClass.thisReceiver!!.type + dispatchReceiverParameter = irSymbolTable.declareValueParameter( + startOffset, endOffset, thisOrigin, WrappedReceiverParameterDescriptor(), + thisType + ) { symbol -> + IrValueParameterImpl( + startOffset, endOffset, thisOrigin, symbol, + Name.special(""), -1, thisType, + varargElementType = null, isCrossinline = false, isNoinline = false + ).apply { this.parent = parent } + } + } } private fun T.bindAndDeclareParameters( function: FirFunction, descriptor: WrappedCallableDescriptor, - setParent: Boolean, + irParent: IrDeclarationParent?, shouldLeaveScope: Boolean ): T { descriptor.bind(this) - if (setParent) { - setParentByOwnFir(function as FirCallableMemberDeclaration) - } enterScope(descriptor) - declareParameters(function) + declareParameters(function, containingClass = irParent as? IrClass) if (shouldLeaveScope) { leaveScope(descriptor) } @@ -233,7 +253,7 @@ class Fir2IrDeclarationStorage( fun getIrFunction( function: FirNamedFunction, - setParent: Boolean = true, + irParent: IrDeclarationParent? = null, shouldLeaveScope: Boolean = false, origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED ): IrSimpleFunction { @@ -249,7 +269,7 @@ class Fir2IrDeclarationStorage( function.isTailRec, function.isSuspend ) } - }.bindAndDeclareParameters(function, descriptor, setParent, shouldLeaveScope) + }.bindAndDeclareParameters(function, descriptor, irParent, shouldLeaveScope) } if (function.visibility == Visibilities.LOCAL) { @@ -285,11 +305,17 @@ class Fir2IrDeclarationStorage( // TODO: suspend lambda isSuspend = false ) - }.bindAndDeclareParameters(function, descriptor, setParent = false, shouldLeaveScope = false) + }.bindAndDeclareParameters( + function, descriptor, irParent = null, shouldLeaveScope = false + ) } } - fun getIrConstructor(constructor: FirConstructor, setParent: Boolean = true, shouldLeaveScope: Boolean = false): IrConstructor { + fun getIrConstructor( + constructor: FirConstructor, + irParent: IrDeclarationParent? = null, + shouldLeaveScope: Boolean = false + ): IrConstructor { return constructorCache.getOrPut(constructor) { val descriptor = WrappedClassConstructorDescriptor() val origin = IrDeclarationOrigin.DEFINED @@ -301,14 +327,14 @@ class Fir2IrDeclarationStorage( constructor.name, constructor.visibility, constructor.returnTypeRef.toIrType(session, this), isInline = false, isExternal = false, isPrimary = isPrimary - ).bindAndDeclareParameters(constructor, descriptor, setParent, shouldLeaveScope) + ).bindAndDeclareParameters(constructor, descriptor, irParent, shouldLeaveScope) } } } } - fun getIrProperty(property: FirProperty, setParent: Boolean = true): IrProperty { + fun getIrProperty(property: FirProperty): IrProperty { return propertyCache.getOrPut(property) { val descriptor = WrappedPropertyDescriptor() val origin = IrDeclarationOrigin.DEFINED @@ -326,9 +352,6 @@ class Fir2IrDeclarationStorage( isExternal = false ).apply { descriptor.bind(this) - if (setParent) { - setParentByOwnFir(property) - } } } } @@ -411,13 +434,19 @@ class Fir2IrDeclarationStorage( } fun getIrFunctionSymbol(firFunctionSymbol: FirFunctionSymbol): IrFunctionSymbol { - return when (val firDeclaration = firFunctionSymbol.fir) { + val firDeclaration = firFunctionSymbol.fir + val irParent = (firDeclaration as? FirCallableMemberDeclaration)?.let { findIrParent(it) } + return when (firDeclaration) { is FirNamedFunction -> { - val irDeclaration = getIrFunction(firDeclaration, shouldLeaveScope = true) + val irDeclaration = getIrFunction(firDeclaration, irParent, shouldLeaveScope = true).apply { + setAndModifyParent(irParent) + } irSymbolTable.referenceSimpleFunction(irDeclaration.descriptor) } is FirConstructor -> { - val irDeclaration = getIrConstructor(firDeclaration, shouldLeaveScope = true) + val irDeclaration = getIrConstructor(firDeclaration, irParent, shouldLeaveScope = true).apply { + setAndModifyParent(irParent) + } irSymbolTable.referenceConstructor(irDeclaration.descriptor) } else -> throw AssertionError("Should not be here") @@ -425,7 +454,10 @@ class Fir2IrDeclarationStorage( } fun getIrPropertySymbol(firPropertySymbol: FirPropertySymbol): IrPropertySymbol { - val irProperty = getIrProperty(firPropertySymbol.fir as FirProperty) + val firProperty = firPropertySymbol.fir as FirProperty + val irProperty = getIrProperty(firProperty).apply { + setAndModifyParent(findIrParent(firProperty)) + } return 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 31b913c47d4..9247e11845e 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 @@ -208,7 +208,9 @@ internal class Fir2IrVisitor( val origin = IrDeclarationOrigin.FAKE_OVERRIDE if (functionSymbol.isFakeOverride) { // Substitution case - val irFunction = declarationStorage.getIrFunction(originalFunction, setParent = false, origin = origin) + val irFunction = declarationStorage.getIrFunction( + originalFunction, declarationStorage.findIrParent(originalFunction), origin = origin + ) val baseSymbol = functionSymbol.overriddenSymbol declarations += irFunction.setParentByParentStack().withFunction { setFunctionContent(irFunction.descriptor, originalFunction, firOverriddenSymbol = baseSymbol) @@ -218,7 +220,9 @@ internal class Fir2IrVisitor( val fakeOverrideSymbol = FirClassSubstitutionScope.createFakeOverride(session, originalFunction, functionSymbol) val fakeOverrideFunction = fakeOverrideSymbol.fir as FirNamedFunction - val irFunction = declarationStorage.getIrFunction(fakeOverrideFunction, setParent = false, origin = origin) + val irFunction = declarationStorage.getIrFunction( + fakeOverrideFunction, declarationStorage.findIrParent(originalFunction), origin = origin + ) declarations += irFunction.setParentByParentStack().withFunction { setFunctionContent(irFunction.descriptor, fakeOverrideFunction, firOverriddenSymbol = functionSymbol) } @@ -340,7 +344,9 @@ internal class Fir2IrVisitor( } override fun visitConstructor(constructor: FirConstructor, data: Any?): IrElement { - val irConstructor = declarationStorage.getIrConstructor(constructor, setParent = false) + val irConstructor = declarationStorage.getIrConstructor( + constructor, irParent = parentStack.last() as? IrClass + ) return irConstructor.setParentByParentStack().withFunction { setFunctionContent(irConstructor.descriptor, constructor) }.withParent { @@ -420,7 +426,9 @@ internal class Fir2IrVisitor( } override fun visitNamedFunction(namedFunction: FirNamedFunction, data: Any?): IrElement { - val irFunction = declarationStorage.getIrFunction(namedFunction, setParent = false) + val irFunction = declarationStorage.getIrFunction( + namedFunction, irParent = parentStack.last() as? IrClass + ) return irFunction.setParentByParentStack().withFunction { setFunctionContent(irFunction.descriptor, namedFunction) } @@ -503,7 +511,7 @@ internal class Fir2IrVisitor( } override fun visitProperty(property: FirProperty, data: Any?): IrProperty { - val irProperty = declarationStorage.getIrProperty(property, setParent = false) + val irProperty = declarationStorage.getIrProperty(property) return irProperty.setParentByParentStack().withProperty { setPropertyContent(irProperty.descriptor, property) } } @@ -517,12 +525,6 @@ internal class Fir2IrVisitor( return this } - private fun T.declareParameters(function: FirFunction) { - return with(declarationStorage) { - declareParameters(function) - } - } - private fun createPropertyAccessor( propertyAccessor: FirPropertyAccessor, startOffset: Int, endOffset: Int, @@ -548,7 +550,7 @@ internal class Fir2IrVisitor( descriptor.bind(this) declarationStorage.enterScope(descriptor) if (!isDefault) { - declareParameters(propertyAccessor) + with(declarationStorage) { declareParameters(propertyAccessor, containingClass = null) } } setFunctionContent(descriptor, propertyAccessor).apply { correspondingPropertySymbol = symbolTable.referenceProperty(correspondingProperty.descriptor) @@ -710,8 +712,33 @@ internal class Fir2IrVisitor( } } + private fun IrExpression.applyReceivers(qualifiedAccess: FirQualifiedAccess): IrExpression { + return when (this) { + is IrCallImpl -> { + val ownerFunction = symbol.owner + if (ownerFunction.dispatchReceiverParameter != null) { + val explicitReceiver = qualifiedAccess.explicitReceiver?.toIrExpression() + if (explicitReceiver != null) { + dispatchReceiver = explicitReceiver + } else { + // TODO: implicit dispatch receiver + } + } else if (ownerFunction.extensionReceiverParameter != null) { + val explicitReceiver = qualifiedAccess.explicitReceiver?.toIrExpression() + if (explicitReceiver != null) { + extensionReceiver = explicitReceiver + } else { + // TODO: implicit extension receiver + } + } + this + } + else -> this + } + } + override fun visitFunctionCall(functionCall: FirFunctionCall, data: Any?): IrElement { - return functionCall.toIrExpression(functionCall.typeRef).applyCallArguments(functionCall) + return functionCall.toIrExpression(functionCall.typeRef).applyCallArguments(functionCall).applyReceivers(functionCall) } override fun visitAnnotationCall(annotationCall: FirAnnotationCall, data: Any?): IrElement { @@ -719,7 +746,7 @@ internal class Fir2IrVisitor( } override fun visitQualifiedAccessExpression(qualifiedAccessExpression: FirQualifiedAccessExpression, data: Any?): IrElement { - return qualifiedAccessExpression.toIrExpression(qualifiedAccessExpression.typeRef) + return qualifiedAccessExpression.toIrExpression(qualifiedAccessExpression.typeRef).applyReceivers(qualifiedAccessExpression) } private fun generateErrorCallExpression(startOffset: Int, endOffset: Int, calleeReference: FirReference): IrErrorCallExpression { diff --git a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt index bbbd2a4e94b..5313379c172 100644 --- a/compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt +++ b/compiler/testData/ir/irText/classes/qualifiedSuperCalls.fir.txt @@ -59,16 +59,21 @@ FILE fqName: fileName:/qualifiedSuperCalls.kt $this: VALUE_PARAMETER name: type:.CBoth BLOCK_BODY CALL 'public open fun foo (): kotlin.Unit declared in .ILeft' type=kotlin.Unit origin=null + $this: ERROR_CALL 'Unresolved reference: super' type=.ILeft CALL 'public open fun foo (): kotlin.Unit declared in .IRight' type=kotlin.Unit origin=null - PROPERTY name:bar visibility:public modality:FINAL [val] + $this: ERROR_CALL 'Unresolved reference: super' type=.IRight + PROPERTY name:bar visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($this:.CBoth) returnType:kotlin.Int correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.CBoth BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .CBoth' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public open fun (): kotlin.Int declared in .ILeft' type=kotlin.Int origin=null + $this: ERROR_CALL 'Unresolved reference: super' type=.ILeft other: CALL 'public open fun (): kotlin.Int declared in .IRight' type=kotlin.Int origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + $this: ERROR_CALL 'Unresolved reference: super' type=.IRight + 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 $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/superCalls.fir.txt b/compiler/testData/ir/irText/classes/superCalls.fir.txt index 54186fc09d8..0a17c1f47cd 100644 --- a/compiler/testData/ir/irText/classes/superCalls.fir.txt +++ b/compiler/testData/ir/irText/classes/superCalls.fir.txt @@ -24,6 +24,7 @@ FILE fqName: fileName:/superCalls.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Base' CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: ERROR_CALL 'Unresolved reference: super<>' type=kotlin.Any 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 @@ -43,13 +44,15 @@ FILE fqName: fileName:/superCalls.kt $this: VALUE_PARAMETER name: type:.Derived BLOCK_BODY CALL 'public open fun foo (): kotlin.Unit declared in .Base' type=kotlin.Unit origin=null - PROPERTY name:bar visibility:public modality:FINAL [val] + $this: ERROR_CALL 'Unresolved reference: super<>' type=.Base + PROPERTY name:bar visibility:public modality:FINAL [val] FUN name: visibility:public modality:FINAL <> ($this:.Derived) returnType:kotlin.String correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Derived BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Derived' CALL 'public open fun (): kotlin.String declared in .Base' type=kotlin.String origin=null + $this: ERROR_CALL 'Unresolved reference: super<>' type=.Base FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:.Base) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in .Base diff --git a/compiler/testData/ir/irText/declarations/constValInitializers.fir.txt b/compiler/testData/ir/irText/declarations/constValInitializers.fir.txt index 5aed5234af5..905862e4e96 100644 --- a/compiler/testData/ir/irText/declarations/constValInitializers.fir.txt +++ b/compiler/testData/ir/irText/declarations/constValInitializers.fir.txt @@ -21,6 +21,9 @@ FILE fqName: fileName:/constValInitializers.kt FIELD PROPERTY_BACKING_FIELD name:I2 type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null + other: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null other: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:I2 visibility:public modality:FINAL [const,val] @@ -40,6 +43,7 @@ FILE fqName: fileName:/constValInitializers.kt FIELD PROPERTY_BACKING_FIELD name:STR2 type:kotlin.String visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CONST String type=kotlin.String value="String" other: CONST String type=kotlin.String value="2" FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:STR2 visibility:public modality:FINAL [const,val] @@ -50,6 +54,7 @@ FILE fqName: fileName:/constValInitializers.kt FIELD PROPERTY_BACKING_FIELD name:STR3 type:kotlin.String visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null other: CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:STR3 visibility:public modality:FINAL [const,val] diff --git a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt index 7a8cb9475cd..7503f9e4515 100644 --- a/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/constructor.fir.txt @@ -188,6 +188,7 @@ FILE fqName: fileName:/constructor.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor (x: kotlin.Int) [primary] declared in .Test4' : x: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Int declared in .Test4.' type=kotlin.Int origin=null other: GET_VAR 'y: kotlin.Int declared in .Test4.' type=kotlin.Int 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/provideDelegate/differentReceivers.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt index ee1a3535f54..94a6b807af1 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/differentReceivers.fir.txt @@ -36,7 +36,8 @@ FILE fqName: fileName:/differentReceivers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=null - FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String + $this: ERROR_CALL 'Unresolved reference: this#' type=.MyClass + FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? VALUE_PARAMETER name:p index:1 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt index 5c1c7beff63..ac2e86ac633 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/localDifferentReceivers.fir.txt @@ -36,7 +36,8 @@ FILE fqName: fileName:/localDifferentReceivers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): kotlin.String declared in ' CALL 'public final fun (): kotlin.String declared in .MyClass' type=kotlin.String origin=null - FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String + $this: ERROR_CALL 'Unresolved reference: this#' type=.MyClass + FUN name:getValue visibility:public modality:FINAL <> (receiver:kotlin.Any?, p:kotlin.Any) returnType:kotlin.String VALUE_PARAMETER name:receiver index:0 type:kotlin.Any? VALUE_PARAMETER name:p index:1 type:kotlin.Any BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt index 30487b99bf2..a8cd0f60ab4 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -30,6 +30,7 @@ FILE fqName: fileName:/memberExtension.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun getValue (receiver: kotlin.String, p: kotlin.Any): kotlin.String declared in .Host.StringDelegate' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'receiver: kotlin.String declared in .Host.StringDelegate.getValue' type=kotlin.String origin=null other: CALL 'public final fun (): kotlin.String declared in .Host.StringDelegate' type=kotlin.String origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: @@ -65,7 +66,8 @@ FILE fqName: fileName:/memberExtension.kt FIELD PROPERTY_BACKING_FIELD name:ok type:IrErrorType visibility:public [final] EXPRESSION_BODY CALL 'public final fun (): IrErrorType declared in .Host' type=IrErrorType origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType + $this: CONST String type=kotlin.String value="O" + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:IrErrorType correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/arrayAccess.fir.txt b/compiler/testData/ir/irText/expressions/arrayAccess.fir.txt index 7899b7f0a60..d96f476a1c5 100644 --- a/compiler/testData/ir/irText/expressions/arrayAccess.fir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAccess.fir.txt @@ -17,6 +17,14 @@ FILE fqName: fileName:/arrayAccess.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (a: kotlin.IntArray): kotlin.Int declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.IntArray declared in .test' type=kotlin.IntArray origin=null + index: CONST Int type=kotlin.Int value=0 + other: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.IntArray declared in .test' type=kotlin.IntArray origin=null + index: CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null other: CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.IntArray declared in .test' type=kotlin.IntArray origin=null index: CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt index 9d7a21bc505..2e002e37312 100644 --- a/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAssignment.fir.txt @@ -7,6 +7,7 @@ FILE fqName: fileName:/arrayAssignment.kt CONST Int type=kotlin.Int value=2 CONST Int type=kotlin.Int value=3 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: GET_VAR 'val x: kotlin.IntArray [val] declared in .test' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=1 value: CONST Int type=kotlin.Int value=0 FUN name:foo visibility:public modality:FINAL <> () returnType:kotlin.Int @@ -16,6 +17,10 @@ FILE fqName: fileName:/arrayAssignment.kt FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: ERROR_CALL 'Cannot bind 3 arguments to intArrayOf call with 1 parameters' type=kotlin.IntArray + CONST Int type=kotlin.Int value=1 + CONST Int type=kotlin.Int value=2 + CONST Int type=kotlin.Int value=3 index: CALL 'public final fun foo (): kotlin.Int declared in ' type=kotlin.Int origin=null value: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt index a47858dace9..d119907301e 100644 --- a/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt +++ b/compiler/testData/ir/irText/expressions/arrayAugmentedAssignment1.fir.txt @@ -56,9 +56,14 @@ FILE fqName: fileName:/arrayAugmentedAssignment1.kt BLOCK_BODY VAR name: type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in .C' type=kotlin.IntArray origin=null + $this: GET_VAR 'c: .C declared in .testMember' type=.C origin=null index: CONST Int type=kotlin.Int value=0 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in .C' type=kotlin.IntArray origin=null + $this: GET_VAR 'c: .C declared in .testMember' type=.C origin=null index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testMember' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testMember' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.fir.txt b/compiler/testData/ir/irText/expressions/booleanOperators.fir.txt deleted file mode 100644 index 08349794c70..00000000000 --- a/compiler/testData/ir/irText/expressions/booleanOperators.fir.txt +++ /dev/null @@ -1,40 +0,0 @@ -FILE fqName: fileName:/booleanOperators.kt - FUN name:test1 visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Boolean - VALUE_PARAMETER name:b index:1 type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=ANDAND - BRANCH - if: GET_VAR 'a: kotlin.Boolean declared in .test1' type=kotlin.Boolean origin=null - then: GET_VAR 'b: kotlin.Boolean declared in .test1' type=kotlin.Boolean origin=null - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: CONST Boolean type=kotlin.Boolean value=false - FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Boolean - VALUE_PARAMETER name:b index:1 type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' - WHEN type=kotlin.Boolean origin=OROR - BRANCH - if: GET_VAR 'a: kotlin.Boolean declared in .test2' type=kotlin.Boolean origin=null - then: CONST Boolean type=kotlin.Boolean value=true - BRANCH - if: CONST Boolean type=kotlin.Boolean value=true - then: GET_VAR 'b: kotlin.Boolean declared in .test2' type=kotlin.Boolean origin=null - FUN name:test1x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Boolean - VALUE_PARAMETER name:b index:1 type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' - CALL 'public final fun and (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null - other: GET_VAR 'b: kotlin.Boolean declared in .test1x' type=kotlin.Boolean origin=null - FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Boolean, b:kotlin.Boolean) returnType:kotlin.Boolean - VALUE_PARAMETER name:a index:0 type:kotlin.Boolean - VALUE_PARAMETER name:b index:1 type:kotlin.Boolean - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test2x (a: kotlin.Boolean, b: kotlin.Boolean): kotlin.Boolean declared in ' - CALL 'public final fun or (other: kotlin.Boolean): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null - other: GET_VAR 'b: kotlin.Boolean declared in .test2x' type=kotlin.Boolean origin=null - diff --git a/compiler/testData/ir/irText/expressions/booleanOperators.kt b/compiler/testData/ir/irText/expressions/booleanOperators.kt index b9053f71d01..55d7b959ff8 100644 --- a/compiler/testData/ir/irText/expressions/booleanOperators.kt +++ b/compiler/testData/ir/irText/expressions/booleanOperators.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test1(a: Boolean, b: Boolean) = a && b fun test2(a: Boolean, b: Boolean) = a || b diff --git a/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt b/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt index f2526deeec4..a0cc95d8866 100644 --- a/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/boundCallableReferences.fir.txt @@ -47,7 +47,8 @@ FILE fqName: fileName:/boundCallableReferences.kt FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=IrErrorType 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 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' diff --git a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt index e2cbbc7eae4..ecf98199829 100644 --- a/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableRefToGenericMember.fir.txt @@ -46,7 +46,9 @@ FILE fqName: fileName:/callableRefToGenericMember.kt FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=IrErrorType 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 RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' diff --git a/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt b/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt index 7bbfb72e5e8..51f3d3f42a9 100644 --- a/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferenceToImportedFromObject.fir.txt @@ -47,7 +47,8 @@ FILE fqName:test fileName:/callableReferenceToImportedFromObject.kt FIELD PROPERTY_BACKING_FIELD name:test1a type:kotlin.String visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): kotlin.String declared in test.Foo' type=kotlin.String origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String + $this: ERROR_CALL 'Unresolved reference: R|test/Foo|' type=test.Foo + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:test1a visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in test' diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt index 293bdffe0fd..56c025976cf 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -16,11 +16,14 @@ FILE fqName: fileName:/coercionToUnit.kt VALUE_PARAMETER name:mc index:0 type:kotlin.collections.MutableCollection BLOCK_BODY CALL 'public abstract fun add (element: kotlin.String): kotlin.Boolean declared in kotlin.collections.MutableCollection' type=kotlin.Boolean origin=null + $this: GET_VAR 'mc: kotlin.collections.MutableCollection declared in .test2' type=kotlin.collections.MutableCollection origin=null element: CONST String type=kotlin.String value="" FUN name:test3 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: ERROR_CALL 'No getter found for R|java/lang/System.out|' type=java.io.PrintStream? x: CONST String type=kotlin.String value="Hello," CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: ERROR_CALL 'No getter found for R|java/lang/System.out|' type=java.io.PrintStream? x: CONST String type=kotlin.String value="world!" diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt index fb52625e99d..a6aa69400d5 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt @@ -120,35 +120,44 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt CONST Int type=kotlin.Int value=0 VAR name: type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.IntArray declared in .test1' type=kotlin.IntArray origin=null index: BLOCK type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] GET_VAR 'var i: kotlin.Int [var] declared in .test1' type=kotlin.Int origin=null ERROR_CALL 'Unresolved reference: R|/i|' type=IrErrorType GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: GET_VAR 'a: kotlin.IntArray declared in .test1' type=kotlin.IntArray origin=null index: BLOCK type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] GET_VAR 'var i: kotlin.Int [var] declared in .test1' type=kotlin.Int origin=null ERROR_CALL 'Unresolved reference: R|/i|' type=IrErrorType GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .test1' type=kotlin.Int origin=null FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name: type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1' type=kotlin.Int origin=null + $this: ERROR_CALL 'Unresolved reference: R|/X1|' type=.X1 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x1 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2' type=kotlin.Int origin=null + $this: ERROR_CALL 'Unresolved reference: R|/X1.X2|' type=.X1.X2 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x2 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .X1.X2.X3' type=kotlin.Int origin=null + $this: ERROR_CALL 'Unresolved reference: R|/X1.X2.X3|' type=.X1.X2.X3 SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x3 type:kotlin.Int visibility:public ' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .test2' type=kotlin.Int origin=null CLASS CLASS name:B modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B @@ -203,7 +212,8 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.Int visibility:public ' type=kotlin.Int origin=null value: CALL 'public final fun (): kotlin.Int declared in .B' type=kotlin.Int origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + $this: GET_VAR 'b: .B declared in .Host.plusAssign' type=.B 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 $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/destructuring1.fir.txt b/compiler/testData/ir/irText/expressions/destructuring1.fir.txt index 7a02f995117..a1227ab2742 100644 --- a/compiler/testData/ir/irText/expressions/destructuring1.fir.txt +++ b/compiler/testData/ir/irText/expressions/destructuring1.fir.txt @@ -53,6 +53,7 @@ FILE fqName: fileName:/destructuring1.kt ERROR_CALL 'Unresolved reference: R|/A|' type=.A VAR name:x type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int declared in .B' type=kotlin.Int origin=null - VAR name:y type:kotlin.Int [val] + $this: GET_VAR 'val : .A [val] declared in .test' type=.A origin=null + VAR name:y type:kotlin.Int [val] CALL 'public final fun component2 (): kotlin.Int declared in .B' type=kotlin.Int origin=null - + $this: GET_VAR 'val : .A [val] declared in .test' type=.A origin=null diff --git a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt index 1edf7edce95..bf64edf5086 100644 --- a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt +++ b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt @@ -58,8 +58,10 @@ FILE fqName: fileName:/destructuringWithUnderscore.kt ERROR_CALL 'Unresolved reference: R|/A|' type=.A VAR name:x type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int declared in .B' type=kotlin.Int origin=null - VAR name:_ type:kotlin.Int [val] + $this: GET_VAR 'val : .A [val] declared in .test' type=.A origin=null + VAR name:_ type:kotlin.Int [val] CALL 'public final fun component2 (): kotlin.Int declared in .B' type=kotlin.Int origin=null - VAR name:z type:kotlin.Int [val] + $this: GET_VAR 'val : .A [val] declared in .test' type=.A origin=null + VAR name:z type:kotlin.Int [val] CALL 'public final fun component3 (): kotlin.Int declared in .B' type=kotlin.Int origin=null - + $this: GET_VAR 'val : .A [val] declared in .test' type=.A origin=null diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt index 60af8ea530f..30c889f5dbc 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt @@ -5,6 +5,7 @@ FILE fqName: fileName:/floatingPointCompareTo.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Int declared in ' CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double @@ -51,6 +52,7 @@ FILE fqName: fileName:/floatingPointCompareTo.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Int declared in ' CALL 'public open fun compareTo (other: kotlin.Float): kotlin.Int declared in kotlin.Float' type=kotlin.Int origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Float diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt index 644047bf14f..52ffd3ec4fe 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt @@ -5,6 +5,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1d (x: kotlin.Double, y: kotlin.Double): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Double declared in .test1d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double declared in .test1d' type=kotlin.Double origin=null FUN name:test2d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Double?) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double @@ -12,6 +13,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2d (x: kotlin.Double, y: kotlin.Double?): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Double declared in .test2d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Double? declared in .test2d' type=kotlin.Double? origin=null FUN name:test3d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double @@ -19,6 +21,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3d (x: kotlin.Double, y: kotlin.Any): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Double declared in .test3d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Any declared in .test3d' type=kotlin.Any origin=null FUN name:test4d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Number) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double @@ -26,6 +29,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4d (x: kotlin.Double, y: kotlin.Number): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Double declared in .test4d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Number declared in .test4d' type=kotlin.Number origin=null FUN name:test5d visibility:public modality:FINAL <> (x:kotlin.Double, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Double @@ -37,6 +41,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Double declared in .test5d' type=kotlin.Double origin=null other: GET_VAR 'y: kotlin.Any declared in .test5d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -58,6 +63,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Any declared in .test6d' type=kotlin.Any origin=null other: GET_VAR 'y: kotlin.Any declared in .test6d' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -68,6 +74,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1f (x: kotlin.Float, y: kotlin.Float): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test1f' type=kotlin.Float origin=null other: GET_VAR 'y: kotlin.Float declared in .test1f' type=kotlin.Float origin=null FUN name:test2f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Float?) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Float @@ -75,6 +82,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2f (x: kotlin.Float, y: kotlin.Float?): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test2f' type=kotlin.Float origin=null other: GET_VAR 'y: kotlin.Float? declared in .test2f' type=kotlin.Float? origin=null FUN name:test3f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Float @@ -82,6 +90,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3f (x: kotlin.Float, y: kotlin.Any): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test3f' type=kotlin.Float origin=null other: GET_VAR 'y: kotlin.Any declared in .test3f' type=kotlin.Any origin=null FUN name:test4f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Number) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Float @@ -89,6 +98,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4f (x: kotlin.Float, y: kotlin.Number): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test4f' type=kotlin.Float origin=null other: GET_VAR 'y: kotlin.Number declared in .test4f' type=kotlin.Number origin=null FUN name:test5f visibility:public modality:FINAL <> (x:kotlin.Float, y:kotlin.Any) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Float @@ -100,6 +110,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Float declared in .test5f' type=kotlin.Float origin=null other: GET_VAR 'y: kotlin.Any declared in .test5f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -121,6 +132,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Any declared in .test6f' type=kotlin.Any origin=null other: GET_VAR 'y: kotlin.Any declared in .test6f' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -142,6 +154,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Any declared in .testFD' type=kotlin.Any origin=null other: GET_VAR 'y: kotlin.Any declared in .testFD' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -163,6 +176,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: CONST Boolean type=kotlin.Boolean value=true then: CONST Boolean type=kotlin.Boolean value=false then: CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.Any declared in .testDF' type=kotlin.Any origin=null other: GET_VAR 'y: kotlin.Any declared in .testDF' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt index c2616667696..ca55e434f87 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/whenByFloatingPoint.fir.txt @@ -23,6 +23,7 @@ FILE fqName: fileName:/whenByFloatingPoint.kt GET_VAR 'x: kotlin.Any declared in .testSmartCastInWhenSubject' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenSubject (x: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN VAR IR_TEMPORARY_VARIABLE name:tmp1_subject type:kotlin.Any [val] @@ -45,6 +46,7 @@ FILE fqName: fileName:/whenByFloatingPoint.kt GET_VAR 'y: kotlin.Any declared in .testSmartCastInWhenCondition' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in ' CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 RETURN type=kotlin.Nothing from='public final fun testSmartCastInWhenCondition (x: kotlin.Double, y: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN VAR IR_TEMPORARY_VARIABLE name:tmp2_subject type:kotlin.Double [val] @@ -68,6 +70,7 @@ FILE fqName: fileName:/whenByFloatingPoint.kt if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Double GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ arg0: GET_VAR 'val tmp3_subject: kotlin.Any [val] declared in .testSmartCastInWhenConditionInBranch' type=kotlin.Any origin=null @@ -86,12 +89,14 @@ FILE fqName: fileName:/whenByFloatingPoint.kt GET_VAR 'x: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in ' CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 WHEN type=kotlin.Int origin=IF BRANCH if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.Float GET_VAR 'y: kotlin.Any declared in .testSmartCastToDifferentTypes' type=kotlin.Any origin=null then: RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in ' CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 RETURN type=kotlin.Nothing from='public final fun testSmartCastToDifferentTypes (x: kotlin.Any, y: kotlin.Any): kotlin.Int declared in ' BLOCK type=kotlin.Int origin=WHEN VAR IR_TEMPORARY_VARIABLE name:tmp4_subject type:kotlin.Any [val] diff --git a/compiler/testData/ir/irText/expressions/for.fir.txt b/compiler/testData/ir/irText/expressions/for.fir.txt index ae086194801..17054600a2e 100644 --- a/compiler/testData/ir/irText/expressions/for.fir.txt +++ b/compiler/testData/ir/irText/expressions/for.fir.txt @@ -6,23 +6,29 @@ FILE fqName: fileName:/for.kt GET_VAR 'ss: kotlin.collections.List declared in .testEmpty' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testEmpty' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null - FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testEmpty' type=kotlin.collections.Iterator origin=null + FUN name:testIterable visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List BLOCK_BODY VAR name: type:kotlin.collections.List [val] GET_VAR 'ss: kotlin.collections.List declared in .testIterable' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testIterable' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testIterable' type=kotlin.collections.Iterator origin=null CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val s: kotlin.String [val] declared in .testIterable' type=kotlin.String origin=null FUN name:testDestructuring visibility:public modality:FINAL <> (pp:kotlin.collections.List>) returnType:kotlin.Unit @@ -32,15 +38,20 @@ FILE fqName: fileName:/for.kt GET_VAR 'pp: kotlin.collections.List> declared in .testDestructuring' type=kotlin.collections.List> origin=null VAR name: type:kotlin.collections.Iterator> [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List' type=kotlin.collections.Iterator> origin=null + $this: GET_VAR 'val : kotlin.collections.List> [val] declared in .testDestructuring' type=kotlin.collections.List> origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null body: BLOCK type=kotlin.Unit origin=null VAR name: type:kotlin.Pair [val] CALL 'public abstract fun next (): kotlin.Pair declared in kotlin.collections.Iterator' type=kotlin.Pair origin=null - VAR name:i type:kotlin.Int [val] + $this: GET_VAR 'val : kotlin.collections.Iterator> [val] declared in .testDestructuring' type=kotlin.collections.Iterator> origin=null + VAR name:i type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int declared in kotlin.Pair' type=kotlin.Int origin=null - VAR name:s type:kotlin.String [val] + $this: GET_VAR 'val : kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null + VAR name:s type:kotlin.String [val] CALL 'public final fun component2 (): kotlin.String declared in kotlin.Pair' type=kotlin.String origin=null + $this: GET_VAR 'val : kotlin.Pair [val] declared in .testDestructuring' type=kotlin.Pair origin=null CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val i: kotlin.Int [val] declared in .testDestructuring' type=kotlin.Int origin=null CALL 'public final fun println (message: kotlin.Any?): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt index adc9d788c56..b74c9425280 100644 --- a/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithBreakContinue.fir.txt @@ -6,11 +6,14 @@ FILE fqName: fileName:/forWithBreakContinue.kt GET_VAR 'ss: kotlin.collections.List declared in .testForBreak1' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testForBreak1' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForBreak1' type=kotlin.collections.Iterator origin=null BREAK label=null loop.label=null FUN name:testForBreak2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List @@ -19,20 +22,26 @@ FILE fqName: fileName:/forWithBreakContinue.kt GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testForBreak2' type=kotlin.collections.List origin=null WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s1 type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null - VAR name: type:kotlin.collections.List [val] + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null + VAR name: type:kotlin.collections.List [val] GET_VAR 'ss: kotlin.collections.List declared in .testForBreak2' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testForBreak2' type=kotlin.collections.List origin=null WHILE label=INNER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s2 type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForBreak2' type=kotlin.collections.Iterator origin=null BREAK label=OUTER loop.label=OUTER BREAK label=INNER loop.label=INNER BREAK label=null loop.label=INNER @@ -44,11 +53,14 @@ FILE fqName: fileName:/forWithBreakContinue.kt GET_VAR 'ss: kotlin.collections.List declared in .testForContinue1' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testForContinue1' type=kotlin.collections.List origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForContinue1' type=kotlin.collections.Iterator origin=null CONTINUE label=null loop.label=null FUN name:testForContinue2 visibility:public modality:FINAL <> (ss:kotlin.collections.List) returnType:kotlin.Unit VALUE_PARAMETER name:ss index:0 type:kotlin.collections.List @@ -57,20 +69,26 @@ FILE fqName: fileName:/forWithBreakContinue.kt GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testForContinue2' type=kotlin.collections.List origin=null WHILE label=OUTER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s1 type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null - VAR name: type:kotlin.collections.List [val] + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null + VAR name: type:kotlin.collections.List [val] GET_VAR 'ss: kotlin.collections.List declared in .testForContinue2' type=kotlin.collections.List origin=null VAR name: type:kotlin.collections.Iterator [val] CALL 'public abstract fun iterator (): kotlin.collections.Iterator declared in kotlin.collections.List' type=kotlin.collections.Iterator origin=null + $this: GET_VAR 'val : kotlin.collections.List [val] declared in .testForContinue2' type=kotlin.collections.List origin=null WHILE label=INNER origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null body: BLOCK type=kotlin.Nothing origin=null VAR name:s2 type:kotlin.String [val] CALL 'public abstract fun next (): kotlin.String declared in kotlin.collections.Iterator' type=kotlin.String origin=null + $this: GET_VAR 'val : kotlin.collections.Iterator [val] declared in .testForContinue2' type=kotlin.collections.Iterator origin=null CONTINUE label=OUTER loop.label=OUTER CONTINUE label=INNER loop.label=INNER CONTINUE label=null loop.label=INNER diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt index 00407dffda0..96e93acf8bb 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt @@ -79,6 +79,7 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt CALL 'public final fun (): kotlin.Int declared in .IntCell' type=kotlin.Int origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public ' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .IReceiver.next' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .IReceiver.next' type=kotlin.Int origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: @@ -99,11 +100,14 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt ERROR_CALL 'Unresolved reference: R|/FiveTimes|' type=.FiveTimes VAR name: type:.IntCell [val] CALL 'public open fun iterator (): .IntCell declared in .IReceiver' type=.IntCell origin=null + $this: GET_VAR 'val : .FiveTimes [val] declared in .test' type=.FiveTimes origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public open fun hasNext (): kotlin.Boolean declared in .IReceiver' type=kotlin.Boolean origin=null + $this: GET_VAR 'val : .IntCell [val] declared in .test' type=.IntCell origin=null body: BLOCK type=kotlin.Unit origin=null VAR name:i type:kotlin.Int [val] CALL 'public open fun next (): kotlin.Int declared in .IReceiver' type=kotlin.Int origin=null + $this: GET_VAR 'val : .IntCell [val] declared in .test' type=.IntCell origin=null CALL 'public final fun println (message: kotlin.Int): kotlin.Unit [inline] declared in kotlin.io' type=kotlin.Unit origin=null message: GET_VAR 'val i: kotlin.Int [val] declared in .test' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt index bc8ccd423c5..f030935735b 100644 --- a/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericConstructorCallWithTypeArguments.fir.txt @@ -4,6 +4,7 @@ FILE fqName: fileName:/genericConstructorCallWithTypeArguments.kt RETURN type=kotlin.Nothing from='public final fun testSimple (): IrErrorType declared in ' ERROR_CALL 'Unresolved reference: #' type=IrErrorType CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=2 other: CONST Int type=kotlin.Int value=3 FUN name:testArray visibility:public modality:FINAL (n:kotlin.Int, block:kotlin.Function0.testArray>) returnType:kotlin.Array.testArray> [inline] TYPE_PARAMETER name:T index:0 variance: superTypes:[] diff --git a/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt b/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt index 07a1991cf95..52d53154e3b 100644 --- a/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt +++ b/compiler/testData/ir/irText/expressions/ifElseIf.fir.txt @@ -17,6 +17,7 @@ FILE fqName: fileName:/ifElseIf.kt arg0: GET_VAR 'i: kotlin.Int declared in .test' type=kotlin.Int origin=null arg1: CONST Int type=kotlin.Int value=0 then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Int type=kotlin.Int value=0 diff --git a/compiler/testData/ir/irText/expressions/in.fir.txt b/compiler/testData/ir/irText/expressions/in.fir.txt index 9ca0072c76c..440037f5548 100644 --- a/compiler/testData/ir/irText/expressions/in.fir.txt +++ b/compiler/testData/ir/irText/expressions/in.fir.txt @@ -5,6 +5,7 @@ FILE fqName: fileName:/in.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean declared in ' CALL 'public abstract fun contains (element: kotlin.Any): kotlin.Boolean declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.collections.Collection declared in .test1' type=kotlin.collections.Collection origin=null element: GET_VAR 'a: kotlin.Any declared in .test1' type=kotlin.Any origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any, x:kotlin.collections.Collection) returnType:kotlin.Boolean VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -12,13 +13,17 @@ FILE fqName: fileName:/in.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Any, x: kotlin.collections.Collection): kotlin.Boolean declared in ' CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null - FUN name:test3 visibility:public modality:FINAL (a:T of .test3, x:kotlin.collections.Collection.test3>) returnType:kotlin.Boolean + $this: CALL 'public abstract fun contains (element: kotlin.Any): kotlin.Boolean declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.collections.Collection declared in .test2' type=kotlin.collections.Collection origin=null + element: GET_VAR 'a: kotlin.Any declared in .test2' type=kotlin.Any origin=null + FUN name:test3 visibility:public modality:FINAL (a:T of .test3, x:kotlin.collections.Collection.test3>) returnType:kotlin.Boolean TYPE_PARAMETER name:T index:0 variance: superTypes:[] VALUE_PARAMETER name:a index:0 type:T of .test3 VALUE_PARAMETER name:x index:1 type:kotlin.collections.Collection.test3> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (a: T of .test3, x: kotlin.collections.Collection.test3>): kotlin.Boolean declared in ' CALL 'public abstract fun contains (element: T of .test3): kotlin.Boolean declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.collections.Collection.test3> declared in .test3' type=kotlin.collections.Collection.test3> origin=null element: GET_VAR 'a: T of .test3 declared in .test3' type=T of .test3 origin=null FUN name:test4 visibility:public modality:FINAL (a:T of .test4, x:kotlin.collections.Collection.test4>) returnType:kotlin.Boolean TYPE_PARAMETER name:T index:0 variance: superTypes:[] @@ -27,4 +32,6 @@ FILE fqName: fileName:/in.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4 (a: T of .test4, x: kotlin.collections.Collection.test4>): kotlin.Boolean declared in ' CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null - + $this: CALL 'public abstract fun contains (element: T of .test4): kotlin.Boolean declared in kotlin.collections.Collection' type=kotlin.Boolean origin=null + $this: GET_VAR 'x: kotlin.collections.Collection.test4> declared in .test4' type=kotlin.collections.Collection.test4> origin=null + element: GET_VAR 'a: T of .test4 declared in .test4' type=T of .test4 origin=null diff --git a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt index c91c60eeb58..93dbe5d3f49 100644 --- a/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/incrementDecrement.fir.txt @@ -66,6 +66,7 @@ FILE fqName: fileName:/incrementDecrement.kt CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null @@ -73,6 +74,7 @@ FILE fqName: fileName:/incrementDecrement.kt CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testPropPrefix' type=kotlin.Int origin=null CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null FUN name:testPropPostfix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -82,6 +84,7 @@ FILE fqName: fileName:/incrementDecrement.kt CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null VAR name:p2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null @@ -89,6 +92,7 @@ FILE fqName: fileName:/incrementDecrement.kt CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:p type:kotlin.Int visibility:public [static] ' type=kotlin.Int origin=null value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testPropPostfix' type=kotlin.Int origin=null CALL 'public final fun (): kotlin.Int declared in ' type=kotlin.Int origin=null FUN name:testArrayPrefix visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -96,10 +100,13 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 VAR name: type:kotlin.Int [val] CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 value: GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null @@ -107,10 +114,13 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 VAR name: type:kotlin.Int [val] CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 value: GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testArrayPrefix' type=kotlin.Int origin=null @@ -120,18 +130,24 @@ FILE fqName: fileName:/incrementDecrement.kt BLOCK type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null VAR name:a2 type:kotlin.Int [val] BLOCK type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int declared in kotlin.IntArray' type=kotlin.Int origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in kotlin.IntArray' type=kotlin.Unit origin=null + $this: CALL 'public final fun (): kotlin.IntArray declared in ' type=kotlin.IntArray origin=null index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun dec (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testArrayPostfix' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt index 7f27f28e418..d71a3e281bf 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt @@ -2,12 +2,14 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt FUN name:testFun visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: ERROR_CALL 'No getter found for R|java/lang/System.out|' type=java.io.PrintStream? x: CONST String type=kotlin.String value="testFun" PROPERTY name:testProp visibility:public modality:FINAL [var] FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Any correspondingProperty: PROPERTY name:testProp visibility:public modality:FINAL [var] BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: ERROR_CALL 'No getter found for R|java/lang/System.out|' type=java.io.PrintStream? x: CONST String type=kotlin.String value="testProp/get" RETURN type=kotlin.Nothing from='public final fun (): kotlin.Any declared in ' CONST Int type=kotlin.Any value=42 @@ -16,6 +18,7 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt VALUE_PARAMETER name:value index:0 type:kotlin.Any BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: ERROR_CALL 'No getter found for R|java/lang/System.out|' type=java.io.PrintStream? x: CONST String type=kotlin.String value="testProp/set" CLASS CLASS name:TestClass modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestClass @@ -31,6 +34,7 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt if: CONST Boolean type=kotlin.Boolean value=true then: BLOCK type=kotlin.Int origin=null CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: ERROR_CALL 'No getter found for R|java/lang/System.out|' type=java.io.PrintStream? x: CONST String type=kotlin.String value="TestClass/test" CONST Int type=kotlin.Int value=42 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestClass) returnType:kotlin.Int @@ -43,6 +47,7 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null + $this: ERROR_CALL 'No getter found for R|java/lang/System.out|' type=java.io.PrintStream? x: CONST String type=kotlin.String value="TestClass/init" 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/expressions/kt28456.fir.txt b/compiler/testData/ir/irText/expressions/kt28456.fir.txt index e843264d4e6..8fd09276d14 100644 --- a/compiler/testData/ir/irText/expressions/kt28456.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456.fir.txt @@ -48,6 +48,7 @@ FILE fqName: fileName:/kt28456.kt i: CONST Int type=kotlin.Int value=1 j: CONST Int type=kotlin.Int value=2 v: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A diff --git a/compiler/testData/ir/irText/expressions/kt28456b.fir.txt b/compiler/testData/ir/irText/expressions/kt28456b.fir.txt index d9163ed8507..eb1f122dfd8 100644 --- a/compiler/testData/ir/irText/expressions/kt28456b.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456b.fir.txt @@ -59,6 +59,7 @@ FILE fqName: fileName:/kt28456b.kt ERROR_CALL 'Unresolved reference: #' type=IrErrorType CONST Int type=kotlin.Int value=1 CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.txt index 37c66b140af..0145be535f2 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.txt @@ -27,19 +27,23 @@ FILE fqName: fileName:/kt30020.kt ERROR_CALL 'Unresolved reference: R|/X.xs|' type=IrErrorType VAR name: type:kotlin.collections.MutableList [val] CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + $this: GET_VAR 'x: .X declared in .test' type=.X origin=null ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType VAR name: type:kotlin.collections.MutableList [val] TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + $this: GET_VAR 'x: .X declared in .test' type=.X origin=null ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType VAR name: type:kotlin.collections.MutableList [val] TYPE_OP type=kotlin.collections.MutableList origin=CAST typeOperand=kotlin.collections.MutableList CALL 'public abstract fun f (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + $this: GET_VAR 'x: .X declared in .test' type=.X origin=null ERROR_CALL 'Unresolved reference: R|/|' type=IrErrorType VAR name: type:kotlin.collections.MutableList [val] BLOCK type=kotlin.collections.MutableList origin=EXCLEXCL VAR name: type:kotlin.collections.MutableList [val] CALL 'public abstract fun (): kotlin.collections.MutableList declared in .X' type=kotlin.collections.MutableList origin=null + $this: GET_VAR 'nx: .X? declared in .test' type=.X? origin=null WHEN type=kotlin.collections.MutableList origin=EXCLEXCL BRANCH if: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQ @@ -153,38 +157,38 @@ FILE fqName: fileName:/kt30020.kt $this: VALUE_PARAMETER name: type:kotlin.collections.MutableList VALUE_PARAMETER name:fromIndex index:0 type:kotlin.Int VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int - FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:.List, element:kotlin.Int) returnType:kotlin.Boolean + FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Boolean overridden: - public abstract fun contains (element: E of ): kotlin.Boolean declared in .List - $this: VALUE_PARAMETER name: type:.List + public abstract fun contains (element: E of ): kotlin.Boolean declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:element index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:.List, elements:kotlin.collections.Collection) returnType:kotlin.Boolean + FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, elements:kotlin.collections.Collection) returnType:kotlin.Boolean overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection>): kotlin.Boolean declared in .List - $this: VALUE_PARAMETER name: type:.List + public abstract fun containsAll (elements: kotlin.collections.Collection>): kotlin.Boolean declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:.List, index:kotlin.Int) returnType:kotlin.Int + FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, index:kotlin.Int) returnType:kotlin.Int overridden: - public abstract fun get (index: kotlin.Int): E of declared in .List - $this: VALUE_PARAMETER name: type:.List + public abstract fun get (index: kotlin.Int): E of declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:index index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:.List, element:kotlin.Int) returnType:kotlin.Int + FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int overridden: - public abstract fun indexOf (element: E of ): kotlin.Int declared in .List - $this: VALUE_PARAMETER name: type:.List + public abstract fun indexOf (element: E of ): kotlin.Int declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:element index:0 type:kotlin.Int - FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:.List) returnType:kotlin.Boolean + FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Boolean overridden: - public abstract fun isEmpty (): kotlin.Boolean declared in .List - $this: VALUE_PARAMETER name: type:.List - FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:.List) returnType:kotlin.collections.Iterator + public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List + FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.collections.Iterator overridden: - public abstract fun iterator (): kotlin.collections.Iterator> declared in .List - $this: VALUE_PARAMETER name: type:.List - FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:.List, element:kotlin.Int) returnType:kotlin.Int + public abstract fun iterator (): kotlin.collections.Iterator> declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List + FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int overridden: - public abstract fun lastIndexOf (element: E of ): kotlin.Int declared in .List - $this: VALUE_PARAMETER name: type:.List + public abstract fun lastIndexOf (element: E of ): kotlin.Int declared in kotlin.collections.List + $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:element index:0 type:kotlin.Int 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/expressions/lambdaInCAO.fir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt index bcfcca83e71..e88937e14e6 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt @@ -36,5 +36,6 @@ FILE fqName: fileName:/lambdaInCAO.kt GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit FUNCTION_REFERENCE 'local final fun (): kotlin.Unit declared in .test3' type=kotlin.Unit origin=LAMBDA value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/literals.fir.txt b/compiler/testData/ir/irText/expressions/literals.fir.txt index d2dd1d3877a..b58bfb1ffd3 100644 --- a/compiler/testData/ir/irText/expressions/literals.fir.txt +++ b/compiler/testData/ir/irText/expressions/literals.fir.txt @@ -12,7 +12,8 @@ FILE fqName: fileName:/literals.kt FIELD PROPERTY_BACKING_FIELD name:test2 type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' @@ -66,7 +67,8 @@ FILE fqName: fileName:/literals.kt FIELD PROPERTY_BACKING_FIELD name:test8 type:kotlin.Long visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Long declared in kotlin.Long' type=kotlin.Long origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + $this: CONST Long type=kotlin.Long value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' @@ -84,7 +86,8 @@ FILE fqName: fileName:/literals.kt FIELD PROPERTY_BACKING_FIELD name:test10 type:kotlin.Double visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Double declared in kotlin.Double' type=kotlin.Double origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Double + $this: CONST Double type=kotlin.Double value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Double correspondingProperty: PROPERTY name:test10 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Double declared in ' @@ -102,7 +105,8 @@ FILE fqName: fileName:/literals.kt FIELD PROPERTY_BACKING_FIELD name:test12 type:kotlin.Float visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Float declared in kotlin.Float' type=kotlin.Float origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Float + $this: CONST Float type=kotlin.Float value=1.0 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Float correspondingProperty: PROPERTY name:test12 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Float declared in ' diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt index c026c29e5b6..72f17f103e0 100644 --- a/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt @@ -68,7 +68,8 @@ FILE fqName: fileName:/membersImportedFromObject.kt FIELD PROPERTY_BACKING_FIELD name:test3 type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun fooExt (): kotlin.Int declared in .A' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' @@ -77,7 +78,8 @@ FILE fqName: fileName:/membersImportedFromObject.kt FIELD PROPERTY_BACKING_FIELD name:test4 type:IrErrorType visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): IrErrorType declared in .A' type=IrErrorType origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType + $this: CONST Int type=kotlin.Int value=1 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:IrErrorType correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): IrErrorType declared in ' diff --git a/compiler/testData/ir/irText/expressions/objectReference.fir.txt b/compiler/testData/ir/irText/expressions/objectReference.fir.txt index fa013e70b74..6b85d4866f6 100644 --- a/compiler/testData/ir/irText/expressions/objectReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectReference.fir.txt @@ -36,6 +36,7 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int 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: ERROR_CALL 'Unresolved reference: R|/Z|' type=.Z CLASS CLASS name:Nested modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Z.Nested CONSTRUCTOR visibility:public <> () returnType:.Z.Nested [primary] @@ -50,7 +51,8 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int 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 - FUN name:test visibility:public modality:FINAL <> ($this:.Z.Nested) returnType:kotlin.Unit + $this: ERROR_CALL 'Unresolved reference: R|/Z|' type=.Z + FUN name:test visibility:public modality:FINAL <> ($this:.Z.Nested) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Z.Nested BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null @@ -59,7 +61,8 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int 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 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean + $this: ERROR_CALL 'Unresolved reference: R|/Z|' type=.Z + 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 $this: VALUE_PARAMETER name: type:kotlin.Any @@ -85,6 +88,7 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int 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: ERROR_CALL 'Unresolved reference: R|/Z|' type=.Z FUNCTION_REFERENCE 'local final fun (): IrErrorType declared in .Z.aLambda' type=IrErrorType origin=LAMBDA FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:IrErrorType correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val] @@ -111,7 +115,8 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int 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 - FUN name:test visibility:public modality:FINAL <> ($this:.Z.anObject.) returnType:kotlin.Unit + $this: ERROR_CALL 'Unresolved reference: R|/Z|' type=.Z + FUN name:test visibility:public modality:FINAL <> ($this:.Z.anObject.) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Z.anObject. BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int origin=null @@ -120,6 +125,7 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int 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: ERROR_CALL 'Unresolved reference: R|/Z|' type=.Z CONSTRUCTOR_CALL 'private constructor () [primary] declared in .Z.anObject.' type=.Z.anObject. origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Z) returnType:kotlin.Any correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] @@ -149,4 +155,4 @@ FILE fqName: fileName:/objectReference.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public ' type=kotlin.Int 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: ERROR_CALL 'Unresolved reference: R|/Z|' type=.Z diff --git a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt index 909c4f6dd88..147f37051cc 100644 --- a/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt +++ b/compiler/testData/ir/irText/expressions/primitivesImplicitConversions.fir.txt @@ -30,7 +30,8 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt FIELD PROPERTY_BACKING_FIELD name:test4 type:kotlin.Long visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long + $this: CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Long correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Long declared in ' @@ -39,7 +40,8 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt FIELD PROPERTY_BACKING_FIELD name:test5 type:kotlin.Short visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Short + $this: CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Short correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Short declared in ' @@ -48,7 +50,8 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt FIELD PROPERTY_BACKING_FIELD name:test6 type:kotlin.Byte visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Byte + $this: CONST Int type=kotlin.Int value=42 + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Byte correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Byte declared in ' @@ -63,16 +66,21 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt CONST Int type=kotlin.Long? value=42 VAR name:test4 type:kotlin.Long? [val] CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - VAR name:test5 type:kotlin.Long? [val] + $this: CONST Int type=kotlin.Int value=1 + VAR name:test5 type:kotlin.Long? [val] CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - VAR name:test6 type:kotlin.Short? [val] + $this: CONST Int type=kotlin.Int value=1 + VAR name:test6 type:kotlin.Short? [val] CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - VAR name:test7 type:kotlin.Byte? [val] + $this: CONST Int type=kotlin.Int value=1 + VAR name:test7 type:kotlin.Byte? [val] CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN name:testImplicitArguments visibility:public modality:FINAL <> (x:kotlin.Long) returnType:kotlin.Unit + $this: CONST Int type=kotlin.Int value=1 + FUN name:testImplicitArguments visibility:public modality:FINAL <> (x:kotlin.Long) returnType:kotlin.Unit VALUE_PARAMETER name:x index:0 type:kotlin.Long EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 BLOCK_BODY CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestImplicitArguments @@ -80,6 +88,7 @@ FILE fqName: fileName:/primitivesImplicitConversions.kt VALUE_PARAMETER name:x index:0 type:kotlin.Long EXPRESSION_BODY CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=1 BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestImplicitArguments modality:FINAL visibility:public superTypes:[kotlin.Any]' diff --git a/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt index 4d5313c647f..fb2bde39def 100644 --- a/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt +++ b/compiler/testData/ir/irText/expressions/propertyReferences.fir.txt @@ -257,7 +257,8 @@ FILE fqName: fileName:/propertyReferences.kt FIELD PROPERTY_BACKING_FIELD name:test_varWithPrivateSet type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: ERROR_CALL 'Unresolved reference: R|/C|' type=.C + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test_varWithPrivateSet visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' @@ -266,7 +267,8 @@ FILE fqName: fileName:/propertyReferences.kt FIELD PROPERTY_BACKING_FIELD name:test_varWithProtectedSet type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: ERROR_CALL 'Unresolved reference: R|/C|' type=.C + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test_varWithProtectedSet visibility:public modality:FINAL [val] BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt index 33212455080..03e08af3554 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt @@ -57,5 +57,6 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit declared in test' type=kotlin.Unit origin=null index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun inc (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'val : kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null GET_VAR 'val : kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt b/compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt index 9ae79ca94bb..f0704c24af2 100644 --- a/compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samOperators.fir.txt @@ -4,16 +4,20 @@ FILE fqName: fileName:/samOperators.kt FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun get (k: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: ERROR_CALL 'Unresolved reference: this#' type=.J k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType CALL 'public open fun get (k: java.lang.Runnable?, m: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: ERROR_CALL 'Unresolved reference: this#' type=.J k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType m: ERROR_CALL 'Unresolved reference: #' type=IrErrorType FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public open fun set (k: java.lang.Runnable?, v: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: ERROR_CALL 'Unresolved reference: this#' type=.J k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType v: ERROR_CALL 'Unresolved reference: #' type=IrErrorType CALL 'public open fun set (k: java.lang.Runnable?, m: java.lang.Runnable?, v: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: ERROR_CALL 'Unresolved reference: this#' type=.J k: ERROR_CALL 'Unresolved reference: #' type=IrErrorType m: ERROR_CALL 'Unresolved reference: #' type=IrErrorType v: ERROR_CALL 'Unresolved reference: #' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/simpleOperators.fir.txt b/compiler/testData/ir/irText/expressions/simpleOperators.fir.txt index 6340aeab9fa..3a941574873 100644 --- a/compiler/testData/ir/irText/expressions/simpleOperators.fir.txt +++ b/compiler/testData/ir/irText/expressions/simpleOperators.fir.txt @@ -5,6 +5,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test1' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test1' type=kotlin.Int origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -12,6 +13,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test2' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test2' type=kotlin.Int origin=null FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -19,6 +21,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test3' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test3' type=kotlin.Int origin=null FUN name:test4 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -26,6 +29,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test4' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test4' type=kotlin.Int origin=null FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -33,6 +37,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test5' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test5' type=kotlin.Int origin=null FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.ranges.IntRange VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -40,6 +45,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test6 (a: kotlin.Int, b: kotlin.Int): kotlin.ranges.IntRange declared in ' CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange declared in kotlin.Int' type=kotlin.ranges.IntRange origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test6' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test6' type=kotlin.Int origin=null FUN name:test1x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -47,6 +53,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1x (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test1x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test1x' type=kotlin.Int origin=null FUN name:test2x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -54,6 +61,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2x (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun minus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test2x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test2x' type=kotlin.Int origin=null FUN name:test3x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -61,6 +69,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3x (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun times (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test3x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test3x' type=kotlin.Int origin=null FUN name:test4x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -68,6 +77,7 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4x (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun div (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test4x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test4x' type=kotlin.Int origin=null FUN name:test5x visibility:public modality:FINAL <> (a:kotlin.Int, b:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:a index:0 type:kotlin.Int @@ -75,5 +85,6 @@ FILE fqName: fileName:/simpleOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5x (a: kotlin.Int, b: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun rem (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'a: kotlin.Int declared in .test5x' type=kotlin.Int origin=null other: GET_VAR 'b: kotlin.Int declared in .test5x' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt index 7fe51a06316..74c830e26f8 100644 --- a/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt +++ b/compiler/testData/ir/irText/expressions/simpleUnaryOperators.fir.txt @@ -4,26 +4,31 @@ FILE fqName: fileName:/simpleUnaryOperators.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (x: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: GET_VAR 'x: kotlin.Int declared in .test1' type=kotlin.Int origin=null + FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (): kotlin.Int declared in ' CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int + $this: CONST Int type=kotlin.Int value=42 + FUN name:test3 visibility:public modality:FINAL <> (x:kotlin.Int) returnType:kotlin.Int VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (x: kotlin.Int): kotlin.Int declared in ' CALL 'public final fun unaryPlus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Int + $this: GET_VAR 'x: kotlin.Int declared in .test3' type=kotlin.Int origin=null + FUN name:test4 visibility:public modality:FINAL <> () returnType:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.Int declared in ' CALL 'public final fun unaryPlus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Boolean) returnType:kotlin.Boolean + $this: CONST Int type=kotlin.Int value=42 + FUN name:test5 visibility:public modality:FINAL <> (x:kotlin.Boolean) returnType:kotlin.Boolean VALUE_PARAMETER name:x index:0 type:kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (x: kotlin.Boolean): kotlin.Boolean declared in ' CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null - FUN name:test6 visibility:public modality:FINAL <> () returnType:kotlin.Boolean + $this: GET_VAR 'x: kotlin.Boolean declared in .test5' type=kotlin.Boolean origin=null + FUN name:test6 visibility:public modality:FINAL <> () returnType:kotlin.Boolean BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test6 (): kotlin.Boolean declared in ' CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=null - + $this: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/stringPlus.fir.txt b/compiler/testData/ir/irText/expressions/stringPlus.fir.txt index 73a422bb166..c89440c51f0 100644 --- a/compiler/testData/ir/irText/expressions/stringPlus.fir.txt +++ b/compiler/testData/ir/irText/expressions/stringPlus.fir.txt @@ -5,6 +5,7 @@ FILE fqName: fileName:/stringPlus.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (a: kotlin.String, b: kotlin.Any): kotlin.String declared in ' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'a: kotlin.String declared in .test1' type=kotlin.String origin=null other: GET_VAR 'b: kotlin.Any declared in .test1' type=kotlin.Any origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.Int) returnType:kotlin.String VALUE_PARAMETER name:a index:0 type:kotlin.String @@ -12,6 +13,9 @@ FILE fqName: fileName:/stringPlus.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2 (a: kotlin.String, b: kotlin.Int): kotlin.String declared in ' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'a: kotlin.String declared in .test2' type=kotlin.String origin=null + other: CONST String type=kotlin.String value="+" other: GET_VAR 'b: kotlin.Int declared in .test2' type=kotlin.Int origin=null FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.String, b:kotlin.Int) returnType:kotlin.String VALUE_PARAMETER name:a index:0 type:kotlin.String @@ -19,5 +23,12 @@ FILE fqName: fileName:/stringPlus.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3 (a: kotlin.String, b: kotlin.Int): kotlin.String declared in ' CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: CALL 'public final fun plus (other: kotlin.Any?): kotlin.String declared in kotlin.String' type=kotlin.String origin=null + $this: GET_VAR 'a: kotlin.String declared in .test3' type=kotlin.String origin=null + other: CONST String type=kotlin.String value="+" + other: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: GET_VAR 'b: kotlin.Int declared in .test3' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=1 other: GET_VAR 'a: kotlin.String declared in .test3' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt index 6c7560dee00..af648614de1 100644 --- a/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt +++ b/compiler/testData/ir/irText/expressions/thisReferenceBeforeClassDeclared.fir.txt @@ -19,6 +19,7 @@ FILE fqName: fileName:/thisReferenceBeforeClassDeclared.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor (a: .WithCompanion.Companion) [primary] declared in .WithCompanion' a: CALL 'public final fun foo (): .WithCompanion.Companion declared in .WithCompanion.Companion' type=.WithCompanion.Companion origin=null + $this: ERROR_CALL 'Unresolved reference: this#' type=.WithCompanion INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name: modality:FINAL visibility:local superTypes:[.WithCompanion]' CONSTRUCTOR_CALL 'private constructor () [primary] declared in .test.' type=.test. origin=null CLASS CLASS name:WithCompanion modality:OPEN visibility:public superTypes:[kotlin.Any] diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt index 25e241d0361..e416e0b36bd 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt @@ -163,6 +163,7 @@ FILE fqName: fileName:/useImportedMember.kt if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'public final fun f (): kotlin.Int declared in .C' type=kotlin.Int origin=null + $this: CONST Boolean type=kotlin.Boolean value=true arg1: CONST Int type=kotlin.String value=3 then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="3" @@ -189,6 +190,7 @@ FILE fqName: fileName:/useImportedMember.kt if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'public final fun (): kotlin.Int declared in .C' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=5 arg1: CONST Int type=kotlin.String value=6 then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="6" @@ -207,6 +209,7 @@ FILE fqName: fileName:/useImportedMember.kt if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'public final fun (): T of declared in .C' type=T of origin=null + $this: CONST String type=kotlin.String value="8" arg1: CONST String type=kotlin.String value="8" then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="8" @@ -223,6 +226,7 @@ FILE fqName: fileName:/useImportedMember.kt if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'public final fun (): T of declared in .BaseClass' type=T of origin=null + $this: CONST String type=kotlin.String value="10" arg1: CONST String type=kotlin.String value="10" then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="10" diff --git a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt index 729bd1929ca..9d4fef02b85 100644 --- a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt +++ b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt @@ -25,13 +25,19 @@ FILE fqName: fileName:/whenWithSubjectVariable.kt then: CONST Int type=IrErrorType value=2 BRANCH if: CALL 'public open fun contains (value: kotlin.Int): kotlin.Boolean declared in kotlin.ranges.IntRange' type=kotlin.Boolean origin=null + $this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange declared in kotlin.Int' type=kotlin.ranges.IntRange origin=null + $this: CONST Int type=kotlin.Int value=0 + other: CONST Int type=kotlin.Int value=10 value: GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null then: CONST Int type=IrErrorType value=3 BRANCH if: CALL 'public open fun contains (value: kotlin.Int): kotlin.Boolean declared in kotlin.ranges.IntRange' type=kotlin.Boolean origin=null + $this: CALL 'public final fun rangeTo (other: kotlin.Int): kotlin.ranges.IntRange declared in kotlin.Int' type=kotlin.ranges.IntRange origin=null + $this: CONST Int type=kotlin.Int value=10 + other: CONST Int type=kotlin.Int value=20 value: GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null then: CONST Int type=IrErrorType value=4 BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CALL 'public final fun unaryMinus (): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null - + $this: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt index bdd01a241c3..eeacb895899 100644 --- a/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt +++ b/compiler/testData/ir/irText/regressions/coercionInLoop.fir.txt @@ -6,18 +6,22 @@ FILE fqName: fileName:/coercionInLoop.kt size: CONST Int type=kotlin.Int value=5 VAR name:x type:kotlin.collections.DoubleIterator [val] CALL 'public final fun iterator (): kotlin.collections.DoubleIterator declared in kotlin.DoubleArray' type=kotlin.collections.DoubleIterator origin=null - VAR name:i type:kotlin.Int [var] + $this: GET_VAR 'val a: kotlin.DoubleArray [val] declared in .box' type=kotlin.DoubleArray origin=null + VAR name:i type:kotlin.Int [var] CONST Int type=kotlin.Int value=0 WHILE label=null origin=WHILE_LOOP condition: CALL 'public abstract fun hasNext (): kotlin.Boolean declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null + $this: GET_VAR 'val x: kotlin.collections.DoubleIterator [val] declared in .box' type=kotlin.collections.DoubleIterator origin=null body: BLOCK type=kotlin.Int origin=null WHEN type=kotlin.String origin=IF BRANCH if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ arg0: CALL 'public final fun get (index: kotlin.Int): kotlin.Double declared in kotlin.DoubleArray' type=kotlin.Double origin=null + $this: GET_VAR 'val a: kotlin.DoubleArray [val] declared in .box' type=kotlin.DoubleArray origin=null index: GET_VAR 'var i: kotlin.Int [var] declared in .box' type=kotlin.Int origin=null arg1: CALL 'public final fun next (): kotlin.Double declared in kotlin.collections.DoubleIterator' type=kotlin.Double origin=null + $this: GET_VAR 'val x: kotlin.collections.DoubleIterator [val] declared in .box' type=kotlin.collections.DoubleIterator origin=null then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' STRING_CONCATENATION type=kotlin.String CONST String type=kotlin.String value="Fail " diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index b01984a27a1..a39f9eaba74 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -8,6 +8,7 @@ FILE fqName: fileName:/builtinMap.kt WHEN type=kotlin.collections.Map.plus, V1 of .plus> origin=IF BRANCH if: CALL 'public abstract fun isEmpty (): kotlin.Boolean declared in kotlin.collections.Map' type=kotlin.Boolean origin=null + $this: ERROR_CALL 'Unresolved reference: this#' type=kotlin.collections.Map.plus, V1 of .plus> then: ERROR_CALL 'Unresolved reference: #' type=IrErrorType GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null BRANCH diff --git a/compiler/testData/ir/irText/stubs/javaMethod.fir.txt b/compiler/testData/ir/irText/stubs/javaMethod.fir.txt deleted file mode 100644 index 0557fc3e168..00000000000 --- a/compiler/testData/ir/irText/stubs/javaMethod.fir.txt +++ /dev/null @@ -1,7 +0,0 @@ -FILE fqName: fileName:/javaMethod.kt - FUN name:test visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit - VALUE_PARAMETER name:j index:0 type:.J - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (j: .J): kotlin.Unit declared in ' - CALL 'public open fun bar (): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - diff --git a/compiler/testData/ir/irText/stubs/javaMethod.kt b/compiler/testData/ir/irText/stubs/javaMethod.kt index a5d3a251dd0..647d84862f7 100644 --- a/compiler/testData/ir/irText/stubs/javaMethod.kt +++ b/compiler/testData/ir/irText/stubs/javaMethod.kt @@ -6,5 +6,6 @@ public class J { } // FILE: javaMethod.kt +// FIR_IDENTICAL fun test(j: J) = j.bar() \ No newline at end of file diff --git a/compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt b/compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt deleted file mode 100644 index 9fcb96e9d68..00000000000 --- a/compiler/testData/ir/irText/stubs/javaNestedClass.fir.txt +++ /dev/null @@ -1,7 +0,0 @@ -FILE fqName: fileName:/javaNestedClass.kt - FUN name:test visibility:public modality:FINAL <> (jj:.J.JJ) returnType:kotlin.Unit - VALUE_PARAMETER name:jj index:0 type:.J.JJ - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (jj: .J.JJ): kotlin.Unit declared in ' - CALL 'public open fun foo (): kotlin.Unit declared in .J.JJ' type=kotlin.Unit origin=null - diff --git a/compiler/testData/ir/irText/stubs/javaNestedClass.kt b/compiler/testData/ir/irText/stubs/javaNestedClass.kt index 9b41e6116e4..69fc05a853f 100644 --- a/compiler/testData/ir/irText/stubs/javaNestedClass.kt +++ b/compiler/testData/ir/irText/stubs/javaNestedClass.kt @@ -10,4 +10,5 @@ public class J { // FILE: javaNestedClass.kt +// FIR_IDENTICAL fun test(jj: J.JJ) = jj.foo() \ No newline at end of file diff --git a/compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt b/compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt deleted file mode 100644 index 56897e1b055..00000000000 --- a/compiler/testData/ir/irText/stubs/kotlinInnerClass.fir.txt +++ /dev/null @@ -1,7 +0,0 @@ -FILE fqName: fileName:/kotlinInnerClass.kt - FUN name:test visibility:public modality:FINAL <> (inner:.Outer.Inner) returnType:kotlin.Unit - VALUE_PARAMETER name:inner index:0 type:.Outer.Inner - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (inner: .Outer.Inner): kotlin.Unit declared in ' - CALL 'public final fun foo (): kotlin.Unit declared in .Outer.Inner' type=kotlin.Unit origin=null - diff --git a/compiler/testData/ir/irText/stubs/kotlinInnerClass.kt b/compiler/testData/ir/irText/stubs/kotlinInnerClass.kt index a358b5441bd..eb4db4b5d1d 100644 --- a/compiler/testData/ir/irText/stubs/kotlinInnerClass.kt +++ b/compiler/testData/ir/irText/stubs/kotlinInnerClass.kt @@ -10,4 +10,5 @@ class Outer { } // FILE: kotlinInnerClass.kt +// FIR_IDENTICAL fun test(inner: Outer.Inner) = inner.foo() \ No newline at end of file diff --git a/compiler/testData/ir/irText/stubs/simple.fir.txt b/compiler/testData/ir/irText/stubs/simple.fir.txt index 9336d00b675..099a2a90a4e 100644 --- a/compiler/testData/ir/irText/stubs/simple.fir.txt +++ b/compiler/testData/ir/irText/stubs/simple.fir.txt @@ -3,6 +3,7 @@ FILE fqName: fileName:/simple.kt FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.Int visibility:public [final,static] EXPRESSION_BODY CALL 'public final fun plus (other: kotlin.Int): kotlin.Int declared in kotlin.Int' type=kotlin.Int origin=null + $this: CONST Int type=kotlin.Int value=2 other: CONST Int type=kotlin.Int value=2 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt index af807cd5710..872a5f3ceba 100644 --- a/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt +++ b/compiler/testData/ir/irText/types/localVariableOfIntersectionType.fir.txt @@ -98,6 +98,11 @@ FILE fqName: fileName:/localVariableOfIntersectionType.kt ERROR_CALL 'Unresolved reference: #' type=IrErrorType VAR name:t type:T of .Inv [val] CALL 'public abstract fun (): T of .Inv declared in .Inv' type=T of .Inv origin=null + $this: CALL 'public abstract fun create (x: .In.Z.create>, y: .In.Z.create>): .Inv.Z.create> declared in .Z' type=IrErrorType 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 ERROR_CALL 'Unresolved reference: #' type=IrErrorType ERROR_CALL 'Unresolved reference: #' type=IrErrorType