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 8bf10fdc4c8..9747a804c9b 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 @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirDefaultPropertySetter import org.jetbrains.kotlin.fir.descriptors.FirModuleDescriptor import org.jetbrains.kotlin.fir.expressions.* import org.jetbrains.kotlin.fir.expressions.impl.FirElseIfTrueCondition +import org.jetbrains.kotlin.fir.expressions.impl.FirNoReceiverExpression import org.jetbrains.kotlin.fir.expressions.impl.FirUnitExpression import org.jetbrains.kotlin.fir.references.FirPropertyFromParameterCallableReference import org.jetbrains.kotlin.fir.resolve.FirSymbolProvider @@ -749,28 +750,28 @@ internal class Fir2IrVisitor( 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 + dispatchReceiver = qualifiedAccess.dispatchReceiver.takeIf { it !is FirNoReceiverExpression }?.toIrExpression() + ?: qualifiedAccess.explicitReceiver?.toIrExpression() // NB: this applies to the situation when call is unresolved + if (dispatchReceiver == null) { + throw AssertionError() } } else if (ownerFunction.extensionReceiverParameter != null) { - val explicitReceiver = qualifiedAccess.explicitReceiver?.toIrExpression() - if (explicitReceiver != null) { - extensionReceiver = explicitReceiver - } else { - // TODO: implicit extension receiver + extensionReceiver = qualifiedAccess.extensionReceiver.takeIf { it !is FirNoReceiverExpression }?.toIrExpression() + ?: qualifiedAccess.explicitReceiver?.toIrExpression() + if (extensionReceiver == null) { + throw AssertionError() } } this } is IrFieldExpressionBase -> { - val explicitReceiver = qualifiedAccess.explicitReceiver?.toIrExpression() - if (explicitReceiver != null) { - receiver = explicitReceiver - } else { - // TODO: implicit receiver + val ownerField = symbol.owner + if (!ownerField.isStatic) { + receiver = qualifiedAccess.dispatchReceiver.takeIf { it !is FirNoReceiverExpression }?.toIrExpression() + ?: qualifiedAccess.explicitReceiver?.toIrExpression() + if (receiver == null) { + throw AssertionError() + } } this } diff --git a/compiler/testData/ir/irText/classes/classMembers.fir.txt b/compiler/testData/ir/irText/classes/classMembers.fir.txt index 06e3bc02e60..13866fffbaa 100644 --- a/compiler/testData/ir/irText/classes/classMembers.fir.txt +++ b/compiler/testData/ir/irText/classes/classMembers.fir.txt @@ -127,6 +127,7 @@ FILE fqName: fileName:/classMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Unit declared in .C.NestedInterface' CALL 'public abstract fun foo (): kotlin.Unit declared in .C.NestedInterface' type=kotlin.Unit origin=null + $this: GET_VAR ': .C.NestedInterface declared in .C.NestedInterface' type=.C.NestedInterface origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/enum.fir.txt b/compiler/testData/ir/irText/classes/enum.fir.txt index 478068334f3..c83b225d676 100644 --- a/compiler/testData/ir/irText/classes/enum.fir.txt +++ b/compiler/testData/ir/irText/classes/enum.fir.txt @@ -321,7 +321,9 @@ FILE fqName: fileName:/enum.kt ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:z type:kotlin.Int visibility:public [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestEnum4.TEST2 declared in .TestEnum4.TEST2' type=.TestEnum4.TEST2 origin=null value: CALL 'public final fun (): kotlin.Int declared in .TestEnum4' type=kotlin.Int origin=null + $this: GET_VAR ': .TestEnum4 declared in .TestEnum4' type=.TestEnum4 origin=null FUN name:foo visibility:public modality:FINAL <> ($this:.TestEnum4.TEST2) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.TestEnum4.TEST2 BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/initVal.fir.txt b/compiler/testData/ir/irText/classes/initVal.fir.txt deleted file mode 100644 index d7307148cd5..00000000000 --- a/compiler/testData/ir/irText/classes/initVal.fir.txt +++ /dev/null @@ -1,94 +0,0 @@ -FILE fqName: fileName:/initVal.kt - CLASS CLASS name:TestInitValFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValFromParameter - CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.TestInitValFromParameter [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValFromParameter modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.Int declared in .TestInitValFromParameter.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValFromParameter) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestInitValFromParameter - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValFromParameter' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .TestInitValFromParameter declared in .TestInitValFromParameter.' type=.TestInitValFromParameter 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 - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:TestInitValInClass modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValInClass - CONSTRUCTOR visibility:public <> () returnType:.TestInitValInClass [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInClass modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] - EXPRESSION_BODY - CONST Int type=kotlin.Int value=0 - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValInClass) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestInitValInClass - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValInClass' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .TestInitValInClass declared in .TestInitValInClass.' type=.TestInitValInClass 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 - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:TestInitValInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestInitValInInitBlock - CONSTRUCTOR visibility:public <> () returnType:.TestInitValInInitBlock [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestInitValInInitBlock modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestInitValInInitBlock) returnType:kotlin.Int - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestInitValInInitBlock - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .TestInitValInInitBlock' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .TestInitValInInitBlock declared in .TestInitValInInitBlock.' type=.TestInitValInInitBlock origin=null - ANONYMOUS_INITIALIZER isStatic=false - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]' type=kotlin.Unit origin=null - value: CONST Int type=kotlin.Int value=0 - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/initVal.kt b/compiler/testData/ir/irText/classes/initVal.kt index fe2fff8274a..5b47f01e4a6 100644 --- a/compiler/testData/ir/irText/classes/initVal.kt +++ b/compiler/testData/ir/irText/classes/initVal.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class TestInitValFromParameter(val x: Int) class TestInitValInClass { diff --git a/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt b/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt index 4484def7249..32a562b8564 100644 --- a/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt +++ b/compiler/testData/ir/irText/classes/outerClassAccess.fir.txt @@ -18,6 +18,7 @@ FILE fqName: fileName:/outerClassAccess.kt $this: VALUE_PARAMETER name: type:.Outer.Inner BLOCK_BODY CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null CLASS CLASS name:Inner2 modality:FINAL visibility:public [inner] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer.Inner.Inner2 CONSTRUCTOR visibility:public <> () returnType:.Outer.Inner.Inner2 [primary] @@ -28,12 +29,15 @@ FILE fqName: fileName:/outerClassAccess.kt $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 BLOCK_BODY CALL 'public final fun test (): kotlin.Unit declared in .Outer.Inner' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer.Inner declared in .Outer.Inner' type=.Outer.Inner origin=null CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null FUN name:test3 visibility:public modality:FINAL <> ($this:.Outer.Inner.Inner2, $receiver:.Outer) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Outer.Inner.Inner2 $receiver: VALUE_PARAMETER name: type:.Outer BLOCK_BODY CALL 'public final fun foo (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt index fc78d0c1b53..af9bbd5306f 100644 --- a/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt +++ b/compiler/testData/ir/irText/classes/secondaryConstructorWithInitializersFromClassBody.fir.txt @@ -62,6 +62,7 @@ FILE fqName: fileName:/secondaryConstructorWithInitializersFromClassBody.k ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.Int visibility:public [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .TestInitBlock declared in .TestInitBlock' type=.TestInitBlock origin=null value: CONST Int type=kotlin.Int value=0 CONSTRUCTOR visibility:public <> () returnType:.TestInitBlock BLOCK_BODY diff --git a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt index 8639ad7e5d4..1bb07b47d5e 100644 --- a/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/delegatedPropertyAccessorsWithAnnotations.fir.txt @@ -60,6 +60,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, kProp: kotlin.Any?): kotlin.Int declared in .Cell' CALL 'public final fun (): kotlin.Int declared in .Cell' type=kotlin.Int origin=null + $this: GET_VAR ': .Cell declared in .Cell' type=.Cell origin=null FUN name:setValue visibility:public modality:FINAL <> ($this:.Cell, thisRef:kotlin.Any?, kProp:kotlin.Any?, newValue:kotlin.Int) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Cell VALUE_PARAMETER name:thisRef index:0 type:kotlin.Any? @@ -67,6 +68,7 @@ FILE fqName: fileName:/delegatedPropertyAccessorsWithAnnotations.kt VALUE_PARAMETER name:newValue index:2 type:kotlin.Int BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Cell declared in .Cell' type=.Cell origin=null value: GET_VAR 'newValue: kotlin.Int declared in .Cell.setValue' 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/kt29833.fir.txt b/compiler/testData/ir/irText/declarations/kt29833.fir.txt index 89f537e1d37..aa0ba8a8566 100644 --- a/compiler/testData/ir/irText/declarations/kt29833.fir.txt +++ b/compiler/testData/ir/irText/declarations/kt29833.fir.txt @@ -9,7 +9,6 @@ FILE fqName:interop fileName:/Definitions.kt FIELD PROPERTY_BACKING_FIELD name:KT_CONSTANT type:kotlin.String? visibility:public [final] EXPRESSION_BODY GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:CONSTANT type:kotlin.String? visibility:public [final,static]' type=kotlin.String? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:Interface modality:OPEN visibility:public/*package*/ superTypes:[kotlin.Any]' type=kotlin.Unit FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String? correspondingProperty: PROPERTY name:KT_CONSTANT visibility:public modality:FINAL [const,val] $this: VALUE_PARAMETER name: type:interop.Definitions @@ -21,7 +20,6 @@ FILE fqName:interop fileName:/Definitions.kt FIELD PROPERTY_BACKING_FIELD name:ktValue type:kotlin.String? visibility:public [final] EXPRESSION_BODY GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:CONSTANT type:kotlin.String? visibility:public [final,static]' type=kotlin.String? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:Interface modality:OPEN visibility:public/*package*/ superTypes:[kotlin.Any]' type=kotlin.Unit FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:interop.Definitions) returnType:kotlin.String? correspondingProperty: PROPERTY name:ktValue visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:interop.Definitions diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt index 6895cb03259..579d2cc843e 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/local.fir.txt @@ -24,6 +24,7 @@ FILE fqName: fileName:/local.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=null + $this: GET_VAR ': .Delegate declared in .Delegate' type=.Delegate origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -63,6 +64,7 @@ FILE fqName: fileName:/local.kt RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=null + $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider' type=.DelegateProvider origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt index 3102ef43fd9..93eeb8cde87 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -32,6 +32,7 @@ FILE fqName: fileName:/memberExtension.kt 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 + $this: GET_VAR ': .Host.StringDelegate declared in .Host.StringDelegate' type=.Host.StringDelegate origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt index 89f2e0878a9..974d142e267 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/topLevel.fir.txt @@ -24,6 +24,7 @@ FILE fqName: fileName:/topLevel.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun getValue (thisRef: kotlin.Any?, property: kotlin.Any?): kotlin.String declared in .Delegate' CALL 'public final fun (): kotlin.String declared in .Delegate' type=kotlin.String origin=null + $this: GET_VAR ': .Delegate declared in .Delegate' type=.Delegate origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any @@ -63,6 +64,7 @@ FILE fqName: fileName:/topLevel.kt RETURN type=kotlin.Nothing from='public final fun provideDelegate (thisRef: kotlin.Any?, property: kotlin.Any?): .Delegate declared in .DelegateProvider' CONSTRUCTOR_CALL 'public constructor (value: kotlin.String) [primary] declared in .Delegate' type=.Delegate origin=null value: CALL 'public final fun (): kotlin.String declared in .DelegateProvider' type=kotlin.String origin=null + $this: GET_VAR ': .DelegateProvider declared in .DelegateProvider' type=.DelegateProvider origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt index cfc3f93162e..53586a7d1b6 100644 --- a/compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt +++ b/compiler/testData/ir/irText/errors/suppressedNonPublicCall.fir.txt @@ -25,3 +25,4 @@ FILE fqName: fileName:/suppressedNonPublicCall.kt $receiver: VALUE_PARAMETER name: type:.C BLOCK_BODY CALL 'internal final fun bar (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null + $this: GET_VAR ': .C declared in .C' type=.C origin=null diff --git a/compiler/testData/ir/irText/expressions/calls.fir.txt b/compiler/testData/ir/irText/expressions/calls.fir.txt deleted file mode 100644 index bb3055ec700..00000000000 --- a/compiler/testData/ir/irText/expressions/calls.fir.txt +++ /dev/null @@ -1,44 +0,0 @@ -FILE fqName: fileName:/calls.kt - FUN name:foo visibility:public modality:FINAL <> (x:kotlin.Int, y:kotlin.Int) returnType:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Int - VALUE_PARAMETER name:y index:1 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' - GET_VAR 'x: kotlin.Int declared in .foo' type=kotlin.Int origin=null - FUN name:bar 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 bar (x: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - x: GET_VAR 'x: kotlin.Int declared in .bar' type=kotlin.Int origin=null - y: CONST Int type=kotlin.Int value=1 - FUN name:qux 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 qux (x: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - x: CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - x: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null - y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null - y: GET_VAR 'x: kotlin.Int declared in .qux' type=kotlin.Int origin=null - FUN name:ext1 visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ext1 (): kotlin.Int declared in ' - GET_VAR ': kotlin.Int declared in .ext1' type=kotlin.Int origin=null - FUN name:ext2 visibility:public modality:FINAL <> ($receiver:kotlin.Int, x:kotlin.Int) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ext2 (x: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - x: GET_VAR ': kotlin.Int declared in .ext2' type=kotlin.Int origin=null - y: GET_VAR 'x: kotlin.Int declared in .ext2' type=kotlin.Int origin=null - FUN name:ext3 visibility:public modality:FINAL <> ($receiver:kotlin.Int, x:kotlin.Int) returnType:kotlin.Int - $receiver: VALUE_PARAMETER name: type:kotlin.Int - VALUE_PARAMETER name:x index:0 type:kotlin.Int - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun ext3 (x: kotlin.Int): kotlin.Int declared in ' - CALL 'public final fun foo (x: kotlin.Int, y: kotlin.Int): kotlin.Int declared in ' type=kotlin.Int origin=null - x: CALL 'public final fun ext1 (): kotlin.Int declared in ' type=kotlin.Int origin=null - y: GET_VAR 'x: kotlin.Int declared in .ext3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/calls.kt b/compiler/testData/ir/irText/expressions/calls.kt index f702390ae5a..c3c27c9f249 100644 --- a/compiler/testData/ir/irText/expressions/calls.kt +++ b/compiler/testData/ir/irText/expressions/calls.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun foo(x: Int, y: Int) = x fun bar(x: Int) = foo(x, 1) fun qux(x: Int) = foo(foo(x, x), x) diff --git a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt index a552e17e9ff..4554a665f4c 100644 --- a/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/coercionToUnit.fir.txt @@ -21,9 +21,7 @@ FILE fqName: fileName:/coercionToUnit.kt BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:System modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:System modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit x: CONST String type=kotlin.String value="world!" diff --git a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt index 161c735182a..46486a37918 100644 --- a/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt +++ b/compiler/testData/ir/irText/expressions/enumEntryReferenceFromEnumEntryClass.fir.txt @@ -38,8 +38,10 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt $this: VALUE_PARAMETER name: type:.MyEnum.Z BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null PROPERTY name:aLambda visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:aLambda type:kotlin.Function0 visibility:public [final] EXPRESSION_BODY @@ -48,8 +50,10 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt $this: VALUE_PARAMETER name: type:.MyEnum.Z BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Function0 correspondingProperty: PROPERTY name:aLambda visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.MyEnum.Z @@ -70,14 +74,18 @@ FILE fqName: fileName:/enumEntryReferenceFromEnumEntryClass.kt ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null FUN name:test visibility:public modality:FINAL <> ($this:.MyEnum.Z.anObject.) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.MyEnum.Z.anObject. BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:counter type:kotlin.Int visibility:public' type=kotlin.Unit origin=null + receiver: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null value: CONST Int type=kotlin.Int value=1 CALL 'public final fun foo (): kotlin.Unit declared in .MyEnum.Z' type=kotlin.Unit origin=null + $this: GET_VAR ': .MyEnum.Z declared in .MyEnum.Z' type=.MyEnum.Z origin=null CONSTRUCTOR_CALL 'private constructor () [primary] declared in .MyEnum.Z.anObject.' type=.MyEnum.Z.anObject. origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MyEnum.Z) returnType:kotlin.Any correspondingProperty: PROPERTY name:anObject visibility:public modality:FINAL [val] diff --git a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt index 481d9ee311d..65db185b15c 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointCompareTo.fir.txt @@ -145,6 +145,7 @@ FILE fqName: fileName:/floatingPointCompareTo.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1fr (x: 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 ': kotlin.Float declared in kotlin.Float' type=kotlin.Float origin=null other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: 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 3ad283d4d03..9b3a6010c6a 100644 --- a/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt +++ b/compiler/testData/ir/irText/expressions/floatingPointComparisons/floatingPointEquals.fir.txt @@ -187,6 +187,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1fr (x: 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 ': kotlin.Any declared in kotlin.Any' type=kotlin.Any origin=null other: GET_VAR 'x: kotlin.Float declared in .test1fr' type=kotlin.Float origin=null FUN name:test2fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Float?) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:kotlin.Float @@ -194,6 +195,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test2fr (x: 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 ': kotlin.Any declared in kotlin.Any' type=kotlin.Any origin=null other: GET_VAR 'x: kotlin.Float? declared in .test2fr' type=kotlin.Float? origin=null FUN name:test3fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:kotlin.Float @@ -201,6 +203,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test3fr (x: 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 ': kotlin.Any declared in kotlin.Any' type=kotlin.Any origin=null other: GET_VAR 'x: kotlin.Any declared in .test3fr' type=kotlin.Any origin=null FUN name:test4fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Number) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:kotlin.Float @@ -208,6 +211,7 @@ FILE fqName: fileName:/floatingPointEquals.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test4fr (x: 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 ': kotlin.Any declared in kotlin.Any' type=kotlin.Any origin=null other: GET_VAR 'x: kotlin.Number declared in .test4fr' type=kotlin.Number origin=null FUN name:test5fr visibility:public modality:FINAL <> ($receiver:kotlin.Float, x:kotlin.Any) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:kotlin.Float @@ -219,6 +223,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Float GET_VAR 'x: kotlin.Any declared in .test5fr' 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 ': kotlin.Any declared in kotlin.Any' type=kotlin.Any origin=null other: GET_VAR 'x: kotlin.Any declared in .test5fr' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true @@ -233,6 +238,7 @@ FILE fqName: fileName:/floatingPointEquals.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=kotlin.Double GET_VAR 'x: kotlin.Any declared in .test6fr' 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 ': kotlin.Any declared in kotlin.Any' type=kotlin.Any origin=null other: GET_VAR 'x: kotlin.Any declared in .test6fr' type=kotlin.Any origin=null BRANCH if: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt index da0f81300f9..659623456e6 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt @@ -73,6 +73,7 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt RETURN type=kotlin.Nothing from='public open fun hasNext (): kotlin.Boolean declared in .IReceiver' CALL 'public final fun greater (arg0: kotlin.Int, arg1: kotlin.Int): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=GT arg0: CALL 'public final fun (): kotlin.Int declared in .IntCell' type=kotlin.Int origin=null + $this: GET_VAR ': .IntCell declared in .IntCell' type=.IntCell origin=null arg1: CONST Int type=kotlin.Int value=0 FUN name:next visibility:public modality:OPEN <> ($this:.IReceiver, $receiver:.IntCell) returnType:kotlin.Int $this: VALUE_PARAMETER name: type:.IReceiver @@ -82,7 +83,9 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt BLOCK type=kotlin.Int origin=null VAR name: type:kotlin.Int [val] CALL 'public final fun (): kotlin.Int declared in .IntCell' type=kotlin.Int origin=null + $this: GET_VAR ': .IntCell declared in .IntCell' type=.IntCell origin=null SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:public' type=kotlin.Unit origin=null + receiver: GET_VAR ': .IntCell declared in .IntCell' type=.IntCell 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 @@ -106,13 +109,13 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt GET_OBJECT 'CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any]' 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 + $this: GET_VAR ': .IReceiver declared in .IReceiver' type=.IReceiver 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 + $this: GET_VAR ': .IReceiver declared in .IReceiver' type=.IReceiver 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 + $this: GET_VAR ': .IReceiver declared in .IReceiver' type=.IReceiver 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/interfaceThisRef.fir.txt b/compiler/testData/ir/irText/expressions/interfaceThisRef.fir.txt index 4f7bff7a073..8f901a94ae0 100644 --- a/compiler/testData/ir/irText/expressions/interfaceThisRef.fir.txt +++ b/compiler/testData/ir/irText/expressions/interfaceThisRef.fir.txt @@ -7,6 +7,7 @@ FILE fqName: fileName:/interfaceThisRef.kt $this: VALUE_PARAMETER name: type:.IFoo BLOCK_BODY CALL 'public abstract fun foo (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null + $this: GET_VAR ': .IFoo declared in .IFoo' type=.IFoo origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt index 778e2bd9adf..cf5f0f0784f 100644 --- a/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/jvmStaticFieldReference.fir.txt @@ -3,7 +3,6 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:System modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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 @@ -11,7 +10,6 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:System modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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 @@ -21,7 +19,6 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:System modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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 @@ -38,7 +35,6 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt 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: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:System modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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 @@ -52,7 +48,6 @@ FILE fqName: fileName:/jvmStaticFieldReference.kt BLOCK_BODY CALL 'public open fun println (x: kotlin.String?): kotlin.Unit declared in java.io.PrintStream' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:out type:java.io.PrintStream? visibility:public [final,static]' type=java.io.PrintStream? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:System modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit 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/outerClassInstanceReference.fir.txt b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt index 7818da550c3..c972b9fc0a9 100644 --- a/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/outerClassInstanceReference.fir.txt @@ -19,6 +19,7 @@ FILE fqName: fileName:/outerClassInstanceReference.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun inner (): kotlin.Unit declared in .Outer.Inner' CALL 'public final fun outer (): kotlin.Unit declared in .Outer' type=kotlin.Unit origin=null + $this: GET_VAR ': .Outer declared in .Outer' type=.Outer origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt index 67fcbe69f31..ff03e1bce9c 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -90,7 +90,7 @@ FILE fqName: fileName:/safeCalls.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (s: kotlin.String?): kotlin.Int declared in ' CALL 'public open fun extLength (): kotlin.Int declared in .IHost' type=kotlin.Int origin=null - $this: GET_VAR 's: kotlin.String? declared in .test5' type=kotlin.String? origin=null + $this: GET_VAR ': .IHost declared in .IHost' type=.IHost origin=null FUN name:foo visibility:public modality:FINAL <> ($receiver:kotlin.Int) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt index 95cdb87aa0b..6ca47189ed3 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversions.fir.txt @@ -6,6 +6,7 @@ FILE fqName: fileName:/samConversions.kt CALL 'public open fun runStatic (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null r: GET_VAR 'a: java.lang.Runnable declared in .test0' type=java.lang.Runnable origin=null CALL 'public open fun runIt (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_VAR ': .J declared in .J' type=.J origin=null r: GET_VAR 'a: java.lang.Runnable declared in .test0' type=java.lang.Runnable origin=null FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -18,6 +19,7 @@ FILE fqName: fileName:/samConversions.kt $receiver: VALUE_PARAMETER name: type:.J BLOCK_BODY CALL 'public open fun runIt (r: java.lang.Runnable?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_VAR ': .J declared in .J' type=.J origin=null r: FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt index 298140214b4..7e4e27977ee 100644 --- a/compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt +++ b/compiler/testData/ir/irText/expressions/temporaryInInitBlock.fir.txt @@ -18,6 +18,7 @@ FILE fqName: fileName:/temporaryInInitBlock.kt ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:s type:kotlin.String? visibility:public [final]' type=kotlin.Unit origin=null + receiver: GET_VAR ': .C declared in .C' type=.C origin=null value: CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null $this: GET_VAR 'x: kotlin.Any? declared in .C.' type=kotlin.Any? origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt index 772cb0dd078..62a9c2ad558 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -103,4 +103,4 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt VALUE_PARAMETER name:it index:0 type:.IInvoke BLOCK_BODY CALL 'public open fun invoke (): kotlin.Int declared in .IInvoke' type=kotlin.Int origin=null - $this: CALL 'public open fun (): .B declared in .IFoo' type=.B origin=null + $this: GET_VAR ': .IInvoke declared in .IInvoke' type=.IInvoke origin=null diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt index 8a9d80e39f3..9ae68b6e1c3 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.txt @@ -25,6 +25,7 @@ FILE fqName: fileName:/enumEntry.kt $this: VALUE_PARAMETER name: type:.Z.ENTRY.A BLOCK_BODY CALL 'public final fun test (): kotlin.Unit declared in .Z.ENTRY' type=kotlin.Unit origin=null + $this: GET_VAR ': .Z.ENTRY declared in .Z.ENTRY' type=.Z.ENTRY origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt index c7b4ac9fcaf..cbea2750cab 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt @@ -16,6 +16,7 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' CALL 'public final fun (): T of .Base declared in .Base' type=T of .Base origin=null + $this: GET_VAR ': .Base declared in .Base' type=.Base<*> origin=null PROPERTY name:bar visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:public EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/stubs/javaEnum.fir.txt b/compiler/testData/ir/irText/stubs/javaEnum.fir.txt index 0d4cbd54a4e..cafbcf9c988 100644 --- a/compiler/testData/ir/irText/stubs/javaEnum.fir.txt +++ b/compiler/testData/ir/irText/stubs/javaEnum.fir.txt @@ -3,7 +3,6 @@ FILE fqName: fileName:/javaEnum.kt FIELD PROPERTY_BACKING_FIELD name:test type:.JEnum? visibility:public [final,static] EXPRESSION_BODY GET_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:ONE type:.JEnum? visibility:public [final,static]' type=.JEnum? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS ENUM_CLASS name:JEnum modality:FINAL visibility:public superTypes:[kotlin.Enum<.JEnum>]' type=kotlin.Unit FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.JEnum? correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/types/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.txt b/compiler/testData/ir/irText/types/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.txt index f92d7c53bb8..6f63d30f9e4 100644 --- a/compiler/testData/ir/irText/types/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.txt +++ b/compiler/testData/ir/irText/types/explicitEqualsAndCompareToCallsOnPlatformTypeReceiver.fir.txt @@ -5,13 +5,16 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiv RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsPlatform (): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null $this: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null other: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null FUN name:testPlatformEqualsKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testPlatformEqualsKotlin (): kotlin.Boolean declared in ' CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null $this: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null other: CONST Double type=kotlin.Double value=0.0 FUN name:testKotlinEqualsPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Boolean $receiver: VALUE_PARAMETER name: type:.JavaClass @@ -20,19 +23,23 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiv CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any' type=kotlin.Boolean origin=null $this: CONST Double type=kotlin.Double value=0.0 other: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null FUN name:testPlatformCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testPlatformCompareToPlatform (): kotlin.Int declared in ' CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null $this: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null other: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null FUN name:testPlatformCompareToKotlin visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.JavaClass BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testPlatformCompareToKotlin (): kotlin.Int declared in ' CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null $this: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null other: CONST Double type=kotlin.Double value=0.0 FUN name:testKotlinCompareToPlatform visibility:public modality:FINAL <> ($receiver:.JavaClass) returnType:kotlin.Int $receiver: VALUE_PARAMETER name: type:.JavaClass @@ -41,3 +48,4 @@ FILE fqName: fileName:/explicitEqualsAndCompareToCallsOnPlatformTypeReceiv CALL 'public open fun compareTo (other: kotlin.Double): kotlin.Int declared in kotlin.Double' type=kotlin.Int origin=null $this: CONST Double type=kotlin.Double value=0.0 other: CALL 'public open fun null0 (): kotlin.Double? declared in .JavaClass' type=kotlin.Double? origin=null + $this: GET_VAR ': .JavaClass declared in .JavaClass' type=.JavaClass origin=null diff --git a/compiler/testData/ir/irText/types/nullabilityAssertionOnExtensionReceiver.fir.txt b/compiler/testData/ir/irText/types/nullabilityAssertionOnExtensionReceiver.fir.txt index 396f6809294..483228f3abf 100644 --- a/compiler/testData/ir/irText/types/nullabilityAssertionOnExtensionReceiver.fir.txt +++ b/compiler/testData/ir/irText/types/nullabilityAssertionOnExtensionReceiver.fir.txt @@ -33,4 +33,4 @@ FILE fqName: fileName:/nullabilityAssertionOnExtensionReceiver.kt $receiver: VALUE_PARAMETER name: type:.C BLOCK_BODY CALL 'public final fun memberExtension (): kotlin.Unit declared in .C' type=kotlin.Unit origin=null - $this: CALL 'public open fun s (): kotlin.String? declared in .J' type=kotlin.String? origin=null + $this: GET_VAR ': .C declared in .C' type=.C origin=null diff --git a/compiler/testData/ir/irText/types/platformTypeReceiver.fir.txt b/compiler/testData/ir/irText/types/platformTypeReceiver.fir.txt index 2ee02e1e886..809e2ea1a62 100644 --- a/compiler/testData/ir/irText/types/platformTypeReceiver.fir.txt +++ b/compiler/testData/ir/irText/types/platformTypeReceiver.fir.txt @@ -4,7 +4,6 @@ FILE fqName: fileName:/platformTypeReceiver.kt RETURN type=kotlin.Nothing from='public final fun test1 (): 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_FIELD 'FIELD IR_EXTERNAL_JAVA_DECLARATION_STUB name:BOOL_NULL type:kotlin.Boolean? visibility:public [static]' type=kotlin.Boolean? origin=GET_PROPERTY - receiver: GET_OBJECT 'CLASS CLASS name:J modality:OPEN visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit other: CONST Null type=kotlin.Nothing? value=null FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Boolean BLOCK_BODY