From d1fac6dce151445b0932d3fa0101ffba99427bd5 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 25 Feb 2020 11:57:16 +0300 Subject: [PATCH] FIR2IR: declare receivers for all accessors of extension properties Before this commit, extension receivers were declared only for properties with container source, which is strange & inconsistent. Now we declare accessor extension receiver iff corresponding property has extension receiver. --- .../fir/backend/Fir2IrDeclarationStorage.kt | 23 ++++---- .../extensionReceiverParameter.kt | 1 - .../delegatedGenericImplementation.fir.txt | 9 ++- .../classes/delegatedImplementation.fir.txt | 18 ++++-- .../receiverParameterWithAnnotations.fir.txt | 6 +- .../declarations/extensionProperties.fir.txt | 55 ------------------- .../declarations/extensionProperties.kt | 1 + .../ir/irText/declarations/kt35550.fir.txt | 3 +- .../parameters/propertyAccessors.fir.txt | 36 ++++++++---- .../typeParameterBeforeBound.fir.txt | 6 +- .../provideDelegate/memberExtension.fir.txt | 5 +- .../expressions/castToTypeParameter.fir.txt | 9 ++- .../complexAugmentedAssignment.fir.txt | 1 + .../destructuringWithUnderscore.fir.txt | 3 + .../extensionPropertyGetterCall.fir.txt | 4 +- .../forWithImplicitReceivers.fir.txt | 3 + .../expressions/genericPropertyCall.fir.txt | 4 +- .../expressions/genericPropertyRef.fir.txt | 12 ++-- .../implicitCastToTypeParameter.fir.txt | 3 +- .../membersImportedFromObject.fir.txt | 5 +- .../ir/irText/expressions/references.fir.txt | 4 +- .../safeCallWithIncrementDecrement.fir.txt | 9 ++- .../ir/irText/expressions/safeCalls.fir.txt | 1 + .../typeParameterClassLiteral.fir.txt | 6 +- .../expressions/useImportedMember.fir.txt | 14 ++++- ...variableAsFunctionCallWithGenerics.fir.txt | 8 ++- .../lambdas/multipleImplicitReceivers.fir.txt | 6 +- .../regressions/integerCoercionToT.fir.txt | 6 +- .../genericClassInDifferentModule_m1.fir.txt | 6 +- .../genericClassInDifferentModule_m2.fir.txt | 6 +- .../stubs/jdkClassSyntheticProperty.fir.txt | 3 +- .../genericPropertyReferenceType.fir.txt | 6 +- 32 files changed, 158 insertions(+), 124 deletions(-) delete mode 100644 compiler/testData/ir/irText/declarations/extensionProperties.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 15033bd1ef1..6307998f10e 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 @@ -409,8 +409,11 @@ class Fir2IrDeclarationStorage( } private fun T.declareParameters( - function: FirFunction<*>?, containingClass: IrClass?, - isStatic: Boolean, parentReceiverType: FirTypeRef? = null + function: FirFunction<*>?, + containingClass: IrClass?, + isStatic: Boolean, + // Can be not-null only for property accessors + parentPropertyReceiverType: FirTypeRef? ) { val parent = this if (function is FirSimpleFunction) { @@ -431,7 +434,7 @@ class Fir2IrDeclarationStorage( } if (function !is FirConstructor) { val thisOrigin = IrDeclarationOrigin.DEFINED - val receiverTypeRef = function?.receiverTypeRef ?: parentReceiverType + val receiverTypeRef = if (function !is FirPropertyAccessor) function?.receiverTypeRef else parentPropertyReceiverType if (receiverTypeRef != null) { extensionReceiverParameter = receiverTypeRef.convertWithOffsets { startOffset, endOffset -> declareThisReceiverParameter( @@ -459,11 +462,11 @@ class Fir2IrDeclarationStorage( irParent: IrDeclarationParent?, isStatic: Boolean, shouldLeaveScope: Boolean, - parentReceiverType: FirTypeRef? = null + parentPropertyReceiverType: FirTypeRef? = null ): T { descriptor.bind(this) enterScope(descriptor) - declareParameters(function, containingClass = irParent as? IrClass, isStatic = isStatic, parentReceiverType = parentReceiverType) + declareParameters(function, irParent as? IrClass, isStatic, parentPropertyReceiverType) if (shouldLeaveScope) { leaveScope(descriptor) } @@ -597,7 +600,7 @@ class Fir2IrDeclarationStorage( origin: IrDeclarationOrigin, startOffset: Int, endOffset: Int, - parentPropertyReceiverType: FirTypeRef? = null + correspondingPropertyReceiverTypeRef: FirTypeRef? ): IrSimpleFunction { val propertyDescriptor = correspondingProperty.descriptor val descriptor = @@ -625,7 +628,7 @@ class Fir2IrDeclarationStorage( } }.bindAndDeclareParameters( propertyAccessor, descriptor, irParent, isStatic = irParent !is IrClass, shouldLeaveScope = true, - parentReceiverType = parentPropertyReceiverType + parentPropertyReceiverType = correspondingPropertyReceiverTypeRef ).apply { if (irParent != null) { parent = irParent @@ -702,7 +705,7 @@ class Fir2IrDeclarationStorage( ).apply { descriptor.bind(this) val type = property.returnTypeRef.toIrType(session, this@Fir2IrDeclarationStorage) - val receiverType = if (property.containerSource != null) property.receiverTypeRef else null + val receiverType = property.receiverTypeRef getter = createIrPropertyAccessor( property.getter, this, type, irParent, false, when { @@ -710,7 +713,7 @@ class Fir2IrDeclarationStorage( property.getter is FirDefaultPropertyGetter -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR else -> origin }, - startOffset, endOffset, parentPropertyReceiverType = receiverType + startOffset, endOffset, correspondingPropertyReceiverTypeRef = receiverType ) if (property.isVar) { setter = createIrPropertyAccessor( @@ -721,7 +724,7 @@ class Fir2IrDeclarationStorage( else -> origin }, startOffset, endOffset, - parentPropertyReceiverType = receiverType + correspondingPropertyReceiverTypeRef = receiverType ) } } diff --git a/compiler/testData/codegen/box/javaInterop/notNullAssertions/extensionReceiverParameter.kt b/compiler/testData/codegen/box/javaInterop/notNullAssertions/extensionReceiverParameter.kt index 5edce7a2c16..9a439469b2f 100644 --- a/compiler/testData/codegen/box/javaInterop/notNullAssertions/extensionReceiverParameter.kt +++ b/compiler/testData/codegen/box/javaInterop/notNullAssertions/extensionReceiverParameter.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // TARGET_BACKEND: JVM // FILE: Test.java diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt index e720629dc8b..5e80651c849 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt @@ -8,16 +8,19 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt VALUE_PARAMETER name:a index:0 type:A of .IBase VALUE_PARAMETER name:b index:1 type:B of .IBase.foo PROPERTY name:id visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>) returnType:kotlin.collections.Map.IBase, C of >? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, $receiver:C of ) returnType:kotlin.collections.Map.IBase, C of >? correspondingProperty: PROPERTY name:id visibility:public modality:ABSTRACT [val] $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:C of PROPERTY name:x visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>) returnType:D of ? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, $receiver:kotlin.collections.List>) returnType:D of ? correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.IBase.IBase> - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, :D of ?) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, $receiver:kotlin.collections.List>, :D of ?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.IBase.IBase> + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List> VALUE_PARAMETER name: index:0 type:D of ? FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt index c443c01a14c..2d4d2678b98 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt @@ -71,16 +71,19 @@ FILE fqName: fileName:/delegatedImplementation.kt $this: VALUE_PARAMETER name: type:.IOther VALUE_PARAMETER name: index:0 type:kotlin.Int PROPERTY name:z1 visibility:public modality:ABSTRACT [val] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int correspondingProperty: PROPERTY name:z1 visibility:public modality:ABSTRACT [val] $this: VALUE_PARAMETER name: type:.IOther + $receiver: VALUE_PARAMETER name: type:kotlin.Byte PROPERTY name:z2 visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther) returnType:kotlin.Int + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte) returnType:kotlin.Int correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.IOther - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, :kotlin.Int) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IOther, $receiver:kotlin.Byte, :kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:z2 visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.IOther + $receiver: VALUE_PARAMETER name: type:kotlin.Byte VALUE_PARAMETER name: index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -138,22 +141,25 @@ FILE fqName: fileName:/delegatedImplementation.kt receiver: GET_VAR ': .otherImpl. declared in .otherImpl..' type=.otherImpl. origin=null value: GET_VAR ': kotlin.Int declared in .otherImpl..' type=kotlin.Int origin=null PROPERTY name:z1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int correspondingProperty: PROPERTY name:z1 visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.otherImpl. + $receiver: VALUE_PARAMETER name: type:kotlin.Byte BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .otherImpl.' CONST Int type=kotlin.Int value=1 PROPERTY name:z2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($this:.otherImpl.) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.otherImpl., $receiver:kotlin.Byte) returnType:kotlin.Int correspondingProperty: PROPERTY name:z2 visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.otherImpl. + $receiver: VALUE_PARAMETER name: type:kotlin.Byte BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .otherImpl.' CONST Int type=kotlin.Int value=2 - FUN name: visibility:public modality:FINAL <> ($this:.otherImpl., value:kotlin.Int) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($this:.otherImpl., $receiver:kotlin.Byte, value:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:z2 visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.otherImpl. + $receiver: VALUE_PARAMETER name: type:kotlin.Byte VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY CONSTRUCTOR_CALL 'private constructor () [primary] declared in .otherImpl.' type=.otherImpl. origin=null diff --git a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt index 2fdd639e6f4..cb75b692aee 100644 --- a/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/receiverParameterWithAnnotations.fir.txt @@ -28,9 +28,10 @@ FILE fqName: fileName:/receiverParameterWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun f (): kotlin.String declared in .A' CONST String type=kotlin.String value="" PROPERTY name:p visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.String + FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.String?) returnType:kotlin.String correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.String? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .A' CONST String type=kotlin.String value="" @@ -53,8 +54,9 @@ FILE fqName: fileName:/receiverParameterWithAnnotations.kt RETURN type=kotlin.Nothing from='public final fun topLevelF (): kotlin.String declared in ' CONST String type=kotlin.String value="" PROPERTY name:topLevelP visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String correspondingProperty: PROPERTY name:topLevelP visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/declarations/extensionProperties.fir.txt b/compiler/testData/ir/irText/declarations/extensionProperties.fir.txt deleted file mode 100644 index 3aabec6576d..00000000000 --- a/compiler/testData/ir/irText/declarations/extensionProperties.fir.txt +++ /dev/null @@ -1,55 +0,0 @@ -FILE fqName: fileName:/extensionProperties.kt - PROPERTY name:test1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - PROPERTY name:test2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [var] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host - CONSTRUCTOR visibility:public <> () returnType:.Host [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:test3 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' - CONST Int type=kotlin.Int value=42 - PROPERTY name:test4 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Int - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Host - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' - CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> ($this:.Host, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Host - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] 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 [fake_override] - 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 [fake_override] - 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/declarations/extensionProperties.kt b/compiler/testData/ir/irText/declarations/extensionProperties.kt index db094790100..3b9decc799c 100644 --- a/compiler/testData/ir/irText/declarations/extensionProperties.kt +++ b/compiler/testData/ir/irText/declarations/extensionProperties.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL val String.test1 get() = 42 var String.test2 diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.txt index 2f97d9b197f..2e28fd7cb84 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.txt @@ -2,9 +2,10 @@ FILE fqName: fileName:/kt35550.kt CLASS INTERFACE name:I modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.I PROPERTY name:id visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.I) returnType:T of + FUN name: visibility:public modality:OPEN <> ($this:.I, $receiver:T of ) returnType:T of correspondingProperty: PROPERTY name:id visibility:public modality:OPEN [val] $this: VALUE_PARAMETER name: type:.I + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): T of declared in .I' ERROR_CALL 'Unresolved reference: this@R|/I.id|' type=T of diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt index 92362ae8e99..73dc03435f4 100644 --- a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt @@ -16,35 +16,41 @@ FILE fqName: fileName:/propertyAccessors.kt VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY PROPERTY name:testExt1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int correspondingProperty: PROPERTY name:testExt1 visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 PROPERTY name:testExt2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.Int correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:testExt2 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:kotlin.String VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY PROPERTY name:testExt3 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:kotlin.Int correspondingProperty: PROPERTY name:testExt3 visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 PROPERTY name:testExt4 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:kotlin.Int correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:T of , value:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:testExt4 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:T of VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] @@ -74,41 +80,47 @@ FILE fqName: fileName:/propertyAccessors.kt VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY PROPERTY name:testMemExt1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:kotlin.String) returnType:kotlin.Int correspondingProperty: PROPERTY name:testMemExt1 visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' CONST Int type=kotlin.Int value=42 PROPERTY name:testMemExt2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:kotlin.String) returnType:kotlin.Int correspondingProperty: PROPERTY name:testMemExt2 visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, value:kotlin.Int) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:kotlin.String, value:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:testMemExt2 visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:kotlin.String VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY PROPERTY name:testMemExt3 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:TT of ) returnType:kotlin.Int correspondingProperty: PROPERTY name:testMemExt3 visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:TT of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' CONST Int type=kotlin.Int value=42 PROPERTY name:testMemExt4 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:TT of ) returnType:kotlin.Int correspondingProperty: PROPERTY name:testMemExt4 visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:TT of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .Host' CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, value:kotlin.Int) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:TT of , value:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:testMemExt4 visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:TT of VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt index bb0be227812..e7145076ebb 100644 --- a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt @@ -25,10 +25,12 @@ FILE fqName: fileName:/typeParameterBeforeBound.kt TYPE_PARAMETER name:U index:0 variance: superTypes:[kotlin.Any?] BLOCK_BODY PROPERTY name:test3 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:.Test1, U of >) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:.Test1, U of > BLOCK_BODY - FUN name: visibility:public modality:FINAL <> (value:kotlin.Unit) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:.Test1, U of >, value:kotlin.Unit) returnType:kotlin.Unit correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:.Test1, U of > VALUE_PARAMETER name:value index:0 type:kotlin.Unit 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 1dccd703f9c..4b1cdbee39e 100644 --- a/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt +++ b/compiler/testData/ir/irText/declarations/provideDelegate/memberExtension.fir.txt @@ -60,11 +60,13 @@ FILE fqName: fileName:/memberExtension.kt EXPRESSION_BODY CALL 'public final fun provideDelegate (host: kotlin.Any?, p: kotlin.Any): .Host.StringDelegate [operator] declared in .Host' type=.Host.StringDelegate origin=null $this: GET_VAR ': .Host declared in .Host' type=.Host origin=null + $receiver: CONST String type=kotlin.String value="K" host: GET_VAR ': .Host declared in .Host' type=.Host origin=null p: PROPERTY_REFERENCE 'public final plusK: kotlin.String [delegated,val]' field=null getter='public final fun (): kotlin.String declared in .Host' setter=null type=kotlin.reflect.KProperty<*> origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.String + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host, $receiver:kotlin.String) returnType:kotlin.String correspondingProperty: PROPERTY name:plusK visibility:public modality:FINAL [delegated,val] $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .Host' CALL 'public final fun getValue (receiver: kotlin.String, p: kotlin.Any): kotlin.String [operator] declared in .Host.StringDelegate' type=kotlin.String origin=null @@ -77,6 +79,7 @@ FILE fqName: fileName:/memberExtension.kt EXPRESSION_BODY CALL 'public final fun (): kotlin.String declared in .Host' type=kotlin.String origin=null $this: GET_VAR ': .Host declared in .Host' type=.Host origin=null + $receiver: CONST String type=kotlin.String value="O" FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.String correspondingProperty: PROPERTY name:ok visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Host diff --git a/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt index ef68524b2d7..8feb72aa90b 100644 --- a/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt @@ -14,8 +14,9 @@ FILE fqName: fileName:/castToTypeParameter.kt TYPE_OP type=T of .castExtFun origin=CAST typeOperand=T of .castExtFun GET_VAR ': kotlin.Any declared in .castExtFun' type=kotlin.Any origin=null PROPERTY name:castExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:T of + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:T of correspondingProperty: PROPERTY name:castExtVal visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of declared in ' TYPE_OP type=T of origin=CAST typeOperand=T of @@ -58,17 +59,19 @@ FILE fqName: fileName:/castToTypeParameter.kt TYPE_OP type=TF of .Host.castGenericMemberExtFun origin=CAST typeOperand=TF of .Host.castGenericMemberExtFun GET_VAR ': kotlin.Any declared in .Host.castGenericMemberExtFun' type=kotlin.Any origin=null PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:T of .Host + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:kotlin.Any) returnType:T of .Host correspondingProperty: PROPERTY name:castMemberExtVal visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:kotlin.Any BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of .Host declared in .Host' TYPE_OP type=T of .Host origin=CAST typeOperand=T of .Host ERROR_CALL 'Unresolved reference: this@R|/Host.castMemberExtVal|' type=kotlin.Any PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:TV of + FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>, $receiver:TV of ) returnType:TV of correspondingProperty: PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Host.Host> + $receiver: VALUE_PARAMETER name: type:TV of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): TV of declared in .Host' TYPE_OP type=TV of origin=CAST typeOperand=TV of diff --git a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt index 05daead08ca..0c6c7dce422 100644 --- a/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt +++ b/compiler/testData/ir/irText/expressions/complexAugmentedAssignment.fir.txt @@ -243,5 +243,6 @@ FILE fqName: fileName:/complexAugmentedAssignment.kt BLOCK_BODY CALL 'public final fun plusAssign (b: .B): kotlin.Unit [operator] declared in .Host' type=kotlin.Unit origin=null $this: GET_VAR ': .Host declared in .test3' type=.Host origin=null + $receiver: GET_VAR 'v: .B declared in .test3' type=.B origin=null b: CONSTRUCTOR_CALL 'public constructor (s: kotlin.Int) [primary] declared in .B' type=.B origin=null s: CONST Int type=kotlin.Int value=1000 diff --git a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt index 0a08a05b581..49c610fb28b 100644 --- a/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt +++ b/compiler/testData/ir/irText/expressions/destructuringWithUnderscore.fir.txt @@ -63,9 +63,12 @@ FILE fqName: fileName:/destructuringWithUnderscore.kt VAR name:x type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int [operator] declared in .B' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null + $receiver: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null VAR name:_ type:kotlin.Int [val] CALL 'public final fun component2 (): kotlin.Int [operator] declared in .B' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null + $receiver: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null VAR name:z type:kotlin.Int [val] CALL 'public final fun component3 (): kotlin.Int [operator] declared in .B' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null + $receiver: GET_VAR 'val tmp_0: .A [val] declared in .test' type=.A origin=null diff --git a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt index 228e4327f7d..7ce97e01d05 100644 --- a/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/extensionPropertyGetterCall.fir.txt @@ -1,7 +1,8 @@ FILE fqName: fileName:/extensionPropertyGetterCall.kt PROPERTY name:okext visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String correspondingProperty: PROPERTY name:okext visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' CONST String type=kotlin.String value="OK" @@ -10,3 +11,4 @@ FILE fqName: fileName:/extensionPropertyGetterCall.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + $receiver: GET_VAR ': kotlin.String declared in .test5' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt index 05c13e78238..0a78b0605b1 100644 --- a/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/expressions/forWithImplicitReceivers.fir.txt @@ -109,12 +109,15 @@ FILE fqName: fileName:/forWithImplicitReceivers.kt VAR FOR_LOOP_ITERATOR name:tmp_1 type:.IntCell [val] CALL 'public open fun iterator (): .IntCell [operator] declared in .IReceiver' type=.IntCell origin=null $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null + $receiver: GET_OBJECT 'CLASS OBJECT name:FiveTimes modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.FiveTimes WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public open fun hasNext (): kotlin.Boolean [operator] declared in .IReceiver' type=kotlin.Boolean origin=null $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null + $receiver: GET_VAR 'val tmp_1: .IntCell [val] declared in .test' type=.IntCell origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR name:i type:kotlin.Int [val] CALL 'public open fun next (): kotlin.Int [operator] declared in .IReceiver' type=kotlin.Int origin=null $this: GET_VAR ': .IReceiver declared in .test' type=.IReceiver origin=null + $receiver: GET_VAR 'val tmp_1: .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/genericPropertyCall.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt index d6a7e283ae1..e0ab8f6d14e 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt @@ -1,7 +1,8 @@ FILE fqName: fileName:/genericPropertyCall.kt PROPERTY name:id visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:T of + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:T of correspondingProperty: PROPERTY name:id visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of declared in ' ERROR_CALL 'Unresolved reference: this@R|/id|' type=T of @@ -9,6 +10,7 @@ FILE fqName: fileName:/genericPropertyCall.kt FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.String visibility:private [final,static] EXPRESSION_BODY CALL 'public final fun (): T of declared in ' type=kotlin.String origin=null + $receiver: CONST String type=kotlin.String value="abc" FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.String correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt index a73dd13ace7..ccbe47c4911 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt @@ -69,8 +69,9 @@ FILE fqName: fileName:/genericPropertyRef.kt EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field='FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:private' getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value>, kotlin.String?> origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($receiver:.Value>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] + $receiver: VALUE_PARAMETER name: type:.Value> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int [operator] declared in .DVal' type=kotlin.Int origin=null @@ -82,8 +83,9 @@ FILE fqName: fileName:/genericPropertyRef.kt EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null kmember: PROPERTY_REFERENCE 'public final value: T of [var]' field=null getter='public final fun (): T of declared in .Value' setter='public final fun (: T of ): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value>, T of > origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int + FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($receiver:.Value>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] + $receiver: VALUE_PARAMETER name: type:.Value> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' CALL 'public final fun getValue (t: kotlin.Any?, p: kotlin.Any): kotlin.Int [operator] declared in .DVal' type=kotlin.Int origin=null @@ -159,13 +161,15 @@ FILE fqName: fileName:/genericPropertyRef.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null value: GET_VAR ': kotlin.Any? declared in .' type=kotlin.Any? origin=null PROPERTY name:bar visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:T of + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:T of correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of declared in ' ERROR_CALL 'Unresolved reference: this@R|/bar|' type=T of - FUN name: visibility:public modality:FINAL <> (value:T of ) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:T of , value:T of ) returnType:kotlin.Unit correspondingProperty: PROPERTY name:bar visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:T of VALUE_PARAMETER name:value index:0 type:T of BLOCK_BODY SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:recivier type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt index 59e70a973d1..29da7e71bc2 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt @@ -29,8 +29,9 @@ FILE fqName: fileName:/implicitCastToTypeParameter.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:asT visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:T of ? + FUN name: visibility:public modality:FINAL <> ($receiver:.Foo>) returnType:T of ? correspondingProperty: PROPERTY name:asT visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:.Foo> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of ? declared in ' WHEN type=T of ? origin=IF diff --git a/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt b/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt index e6db74c154b..e6a9b05438e 100644 --- a/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt +++ b/compiler/testData/ir/irText/expressions/membersImportedFromObject.fir.txt @@ -28,9 +28,10 @@ FILE fqName: fileName:/membersImportedFromObject.kt GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:bar type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null PROPERTY name:barExt visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.A) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.A, $receiver:kotlin.Int) returnType:kotlin.Int correspondingProperty: PROPERTY name:barExt visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .A' CONST Int type=kotlin.Int value=43 @@ -72,6 +73,7 @@ FILE fqName: fileName:/membersImportedFromObject.kt EXPRESSION_BODY CALL 'public final fun fooExt (): kotlin.Int declared in .A' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=1 + $receiver: 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 @@ -82,6 +84,7 @@ FILE fqName: fileName:/membersImportedFromObject.kt EXPRESSION_BODY CALL 'public final fun (): kotlin.Int declared in .A' type=kotlin.Int origin=null $this: CONST Int type=kotlin.Int value=1 + $receiver: CONST Int type=kotlin.Int value=1 FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.Int correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/references.fir.txt b/compiler/testData/ir/irText/expressions/references.fir.txt index aa769def9d3..d173188bed2 100644 --- a/compiler/testData/ir/irText/expressions/references.fir.txt +++ b/compiler/testData/ir/irText/expressions/references.fir.txt @@ -43,8 +43,9 @@ FILE fqName: fileName:/references.kt RETURN type=kotlin.Nothing from='public final fun test4 (): kotlin.String declared in ' CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null PROPERTY name:okext visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.String + FUN name: visibility:public modality:FINAL <> ($receiver:kotlin.String) returnType:kotlin.String correspondingProperty: PROPERTY name:okext visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in ' CONST String type=kotlin.String value="OK" @@ -53,3 +54,4 @@ FILE fqName: fileName:/references.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test5 (): kotlin.String declared in ' CALL 'public final fun (): kotlin.String declared in ' type=kotlin.String origin=null + $receiver: GET_VAR ': kotlin.String declared in .test5' type=kotlin.String origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt index 001e735e67b..765433f99b4 100644 --- a/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCallWithIncrementDecrement.fir.txt @@ -19,13 +19,15 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:p visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($receiver:test.C?) returnType:kotlin.Int correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:test.C? BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in test' CONST Int type=kotlin.Int value=42 - FUN name: visibility:public modality:FINAL <> (value:kotlin.Int) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:test.C?, value:kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY name:p visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:test.C? VALUE_PARAMETER name:value index:0 type:kotlin.Int BLOCK_BODY FUN name:inc visibility:public modality:FINAL <> ($receiver:kotlin.Int?) returnType:kotlin.Int? [operator] @@ -50,6 +52,7 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt BLOCK_BODY VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int? [val] CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int? origin=null + $receiver: GET_VAR 'nc: test.C? declared in test.testProperty' type=test.C? origin=null ERROR_CALL 'Unresolved reference: R|test/p|' type=IrErrorType GET_VAR 'val tmp_0: kotlin.Int? [val] declared in test.testProperty' type=kotlin.Int? origin=null FUN name:testArrayAccess visibility:public modality:FINAL <> (nc:test.C?) returnType:kotlin.Unit @@ -58,9 +61,11 @@ FILE fqName:test fileName:/safeCallWithIncrementDecrement.kt VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Int): kotlin.Int [operator] declared in test' type=kotlin.Int origin=null $receiver: CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int? origin=null + $receiver: GET_VAR 'nc: test.C? declared in test.testArrayAccess' type=test.C? origin=null index: CONST Int type=kotlin.Int value=0 CALL 'public final fun set (index: kotlin.Int, value: kotlin.Int): kotlin.Unit [operator] declared in test' type=kotlin.Unit origin=null $receiver: CALL 'public final fun (): kotlin.Int declared in test' type=kotlin.Int? origin=null + $receiver: GET_VAR 'nc: test.C? declared in test.testArrayAccess' type=test.C? origin=null index: CONST Int type=kotlin.Int value=0 value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_1: kotlin.Int [val] declared in test.testArrayAccess' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt index 5dac7077885..962f78f51b4 100644 --- a/compiler/testData/ir/irText/expressions/safeCalls.fir.txt +++ b/compiler/testData/ir/irText/expressions/safeCalls.fir.txt @@ -93,6 +93,7 @@ FILE fqName: fileName:/safeCalls.kt 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 ': .IHost declared in .test5' type=.IHost origin=null + $receiver: GET_VAR 's: kotlin.String? declared in .test5' type=kotlin.String? 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/typeParameterClassLiteral.fir.txt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt index fe6898516de..5e305284baf 100644 --- a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt @@ -11,8 +11,9 @@ FILE fqName: fileName:/typeParameterClassLiteral.kt RETURN type=kotlin.Nothing from='public final fun classRefExtFun (): kotlin.reflect.KClass.classRefExtFun> [inline] declared in ' CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any]' type=kotlin.reflect.KClass.classRefExtFun> PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KClass> + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:kotlin.reflect.KClass> correspondingProperty: PROPERTY name:classRefExtVal visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass> declared in ' CLASS_REFERENCE 'TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any]' type=kotlin.reflect.KClass> @@ -36,9 +37,10 @@ FILE fqName: fileName:/typeParameterClassLiteral.kt RETURN type=kotlin.Nothing from='public final fun classRefGenericMemberExtFun (): kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> [inline] declared in .Host' CLASS_REFERENCE 'TYPE_PARAMETER name:TF index:0 variance: superTypes:[kotlin.Any]' type=kotlin.reflect.KClass.Host.classRefGenericMemberExtFun> PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.reflect.KClass> + FUN name: visibility:public modality:FINAL <> ($this:.Host, $receiver:TV of ) returnType:kotlin.reflect.KClass> correspondingProperty: PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.Host + $receiver: VALUE_PARAMETER name: type:TV of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass> declared in .Host' CLASS_REFERENCE 'TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any]' type=kotlin.reflect.KClass> diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt index ed43b798f83..5200eedef76 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt @@ -35,9 +35,10 @@ FILE fqName: fileName:/useImportedMember.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:BaseClass modality:OPEN visibility:public superTypes:[kotlin.Any]' PROPERTY name:fromClass visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.BaseClass) returnType:T of + FUN name: visibility:public modality:FINAL <> ($this:.BaseClass, $receiver:T of ) returnType:T of correspondingProperty: PROPERTY name:fromClass visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.BaseClass + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of declared in .BaseClass' ERROR_CALL 'Unresolved reference: this@R|/BaseClass.fromClass|' type=T of @@ -98,9 +99,10 @@ FILE fqName: fileName:/useImportedMember.kt receiver: GET_VAR ': .C declared in .C.' type=.C origin=null value: GET_VAR ': kotlin.Int declared in .C.' type=kotlin.Int origin=null PROPERTY name:ext visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Int + FUN name: visibility:public modality:FINAL <> ($this:.C, $receiver:kotlin.Int) returnType:kotlin.Int correspondingProperty: PROPERTY name:ext visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.C + $receiver: VALUE_PARAMETER name: type:kotlin.Int BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .C' CONST Int type=kotlin.Int value=6 @@ -112,9 +114,10 @@ FILE fqName: fileName:/useImportedMember.kt RETURN type=kotlin.Nothing from='public final fun g1 (t: T of .C.g1): T of .C.g1 declared in .C' GET_VAR 't: T of .C.g1 declared in .C.g1' type=T of .C.g1 origin=null PROPERTY name:g2 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.C) returnType:T of + FUN name: visibility:public modality:FINAL <> ($this:.C, $receiver:T of ) returnType:T of correspondingProperty: PROPERTY name:g2 visibility:public modality:FINAL [val] $this: VALUE_PARAMETER name: type:.C + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of declared in .C' ERROR_CALL 'Unresolved reference: this@R|/C.g2|' type=T of @@ -176,6 +179,7 @@ FILE fqName: fileName:/useImportedMember.kt $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 + $receiver: CONST Boolean type=kotlin.Boolean value=true arg1: CONST Int type=kotlin.Int value=3 then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="3" @@ -206,6 +210,7 @@ FILE fqName: fileName:/useImportedMember.kt $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 + $receiver: CONST Int type=kotlin.Int value=5 arg1: CONST Int type=kotlin.Int value=6 then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="6" @@ -226,6 +231,7 @@ FILE fqName: fileName:/useImportedMember.kt $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=kotlin.String origin=null $this: CONST String type=kotlin.String value="8" + $receiver: 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" @@ -236,6 +242,7 @@ FILE fqName: fileName:/useImportedMember.kt arg0: CALL 'public open fun fromInterface (): T of .I.fromInterface declared in .I' type=kotlin.Int origin=null : kotlin.Int $this: CONST Int type=kotlin.Int value=9 + $receiver: CONST Int type=kotlin.Int value=9 arg1: CONST Int type=kotlin.Int value=9 then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' CONST String type=kotlin.String value="9" @@ -245,6 +252,7 @@ FILE fqName: fileName:/useImportedMember.kt $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=kotlin.String origin=null $this: CONST String type=kotlin.String value="10" + $receiver: 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/variableAsFunctionCallWithGenerics.fir.txt b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt index 769254c975d..b8a4afa81bb 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt @@ -1,7 +1,8 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt PROPERTY name:gk visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Function0> + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:kotlin.Function0> correspondingProperty: PROPERTY name:gk visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0> declared in ' FUN_EXPR type=kotlin.Function0> origin=LAMBDA @@ -15,9 +16,11 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt RETURN type=kotlin.Nothing from='public final fun testGeneric1 (x: kotlin.String): T of declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of origin=INVOKE $this: CALL 'public final fun (): kotlin.Function0> declared in ' type=kotlin.Function0 origin=null + $receiver: GET_VAR 'x: kotlin.String declared in .testGeneric1' type=kotlin.String origin=null PROPERTY name:kt26531Val visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Function0> + FUN name: visibility:public modality:FINAL <> ($receiver:T of ) returnType:kotlin.Function0> correspondingProperty: PROPERTY name:kt26531Val visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:T of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0> declared in ' FUN_EXPR type=kotlin.Function0> origin=LAMBDA @@ -30,3 +33,4 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt RETURN type=kotlin.Nothing from='public final fun kt26531 (): T of declared in ' CALL 'public abstract fun invoke (): R of kotlin.Function0 [operator] declared in kotlin.Function0' type=T of origin=INVOKE $this: CALL 'public final fun (): kotlin.Function0> declared in ' type=kotlin.Function0 origin=null + $receiver: CONST Int type=kotlin.Int value=7 diff --git a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt index 799906b61ee..6efc5555259 100644 --- a/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt +++ b/compiler/testData/ir/irText/lambdas/multipleImplicitReceivers.fir.txt @@ -40,9 +40,10 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo PROPERTY name:foo visibility:public modality:OPEN [val] - FUN name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:.B + FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:.A) returnType:.B correspondingProperty: PROPERTY name:foo visibility:public modality:OPEN [val] $this: VALUE_PARAMETER name: type:.IFoo + $receiver: VALUE_PARAMETER name: type:.A BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): .B declared in .IFoo' GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.B @@ -113,3 +114,6 @@ FILE fqName: fileName:/multipleImplicitReceivers.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.Int declared in .test..' CALL 'public open fun invoke (): kotlin.Int [operator] declared in .IInvoke' type=kotlin.Int origin=null $this: GET_VAR ': .IInvoke declared in special.' type=.IInvoke origin=null + $receiver: CALL 'public open fun (): .B declared in .IFoo' type=.B origin=null + $this: GET_VAR ': .IFoo declared in special.' type=.IFoo origin=null + $receiver: GET_VAR ': .A declared in special.' type=.A origin=null diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt index 1a75d29a836..12306d81336 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt @@ -41,13 +41,15 @@ FILE fqName: fileName:/integerCoercionToT.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:value visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:T_INT of + FUN name: visibility:public modality:FINAL <> ($receiver:.CInt32VarX>) returnType:T_INT of correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:.CInt32VarX> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T_INT of declared in ' CALL 'public final fun TODO (): kotlin.Nothing [inline] declared in kotlin' type=kotlin.Nothing origin=null - FUN name: visibility:public modality:FINAL <> (value:T_INT of ) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:.CInt32VarX>, value:T_INT of ) returnType:kotlin.Unit correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:.CInt32VarX> VALUE_PARAMETER name:value index:0 type:T_INT of BLOCK_BODY CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed] diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt index e4e4c2cbd0a..125c058150d 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt @@ -31,12 +31,14 @@ FILE fqName: fileName:/genericClassInDifferentModule_m1.kt $this: VALUE_PARAMETER name: type:.Base.Base> VALUE_PARAMETER name: index:0 type:T of .Base PROPERTY name:exn visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base.Base>) returnType:T of .Base + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base.Base>, $receiver:Z of ) returnType:T of .Base correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.Base.Base> - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base.Base>, :T of .Base) returnType:kotlin.Unit + $receiver: VALUE_PARAMETER name: type:Z of + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.Base.Base>, $receiver:Z of , :T of .Base) returnType:kotlin.Unit correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var] $this: VALUE_PARAMETER name: type:.Base.Base> + $receiver: VALUE_PARAMETER name: type:Z of VALUE_PARAMETER name: index:0 type:T of .Base FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt index 367602668df..5f358059b6e 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt @@ -37,16 +37,18 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt receiver: GET_VAR ': .Derived1.Derived1> declared in .Derived1.' type=.Derived1.Derived1> origin=null value: GET_VAR ': T of .Derived1 declared in .Derived1.' type=T of .Derived1 origin=null PROPERTY name:exn visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($this:.Derived1.Derived1>) returnType:T of .Derived1 + FUN name: visibility:public modality:FINAL <> ($this:.Derived1.Derived1>, $receiver:Z of ) returnType:T of .Derived1 correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.Derived1.Derived1> + $receiver: VALUE_PARAMETER name: type:Z of BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of .Derived1 declared in .Derived1' CALL 'public final fun (): T of .Derived1 declared in .Base' type=T of .Derived1 origin=null $this: GET_VAR ': .Derived1.Derived1> declared in .Derived1.' type=.Derived1.Derived1> origin=null - FUN name: visibility:public modality:FINAL <> ($this:.Derived1.Derived1>, value:T of .Derived1) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($this:.Derived1.Derived1>, $receiver:Z of , value:T of .Derived1) returnType:kotlin.Unit correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var] $this: VALUE_PARAMETER name: type:.Derived1.Derived1> + $receiver: VALUE_PARAMETER name: type:Z of VALUE_PARAMETER name:value index:0 type:T of .Derived1 BLOCK_BODY PROPERTY FAKE_OVERRIDE name:x visibility:public modality:FINAL [fake_override,val] diff --git a/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt b/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt index b8e6b7a5b82..01a7ba57071 100644 --- a/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt +++ b/compiler/testData/ir/irText/stubs/jdkClassSyntheticProperty.fir.txt @@ -1,7 +1,8 @@ FILE fqName: fileName:/jdkClassSyntheticProperty.kt PROPERTY name:test visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> () returnType:kotlin.Array? + FUN name: visibility:public modality:FINAL <> ($receiver:java.lang.Class<*>) returnType:kotlin.Array? correspondingProperty: PROPERTY name:test visibility:public modality:FINAL [val] + $receiver: VALUE_PARAMETER name: type:java.lang.Class<*> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): kotlin.Array? declared in ' CALL 'public open fun (): kotlin.Array? declared in java.lang.Class' type=kotlin.Array? origin=null diff --git a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt index 473baaf3048..c1faeaf4dd8 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt @@ -40,14 +40,16 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any PROPERTY name:y visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> () returnType:T of + FUN name: visibility:public modality:FINAL <> ($receiver:.C>) returnType:T of correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:.C> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of declared in ' CALL 'public final fun (): T of declared in .C' type=T of origin=null $this: ERROR_CALL 'Unresolved reference: this@R|/y|' type=.C> - FUN name: visibility:public modality:FINAL <> (v:T of ) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL <> ($receiver:.C>, v:T of ) returnType:kotlin.Unit correspondingProperty: PROPERTY name:y visibility:public modality:FINAL [var] + $receiver: VALUE_PARAMETER name: type:.C> VALUE_PARAMETER name:v index:0 type:T of BLOCK_BODY ERROR_CALL 'Unresolved reference: R|FakeOverride|' type=IrErrorType