From 3a3d6e740ccc4cacca304658a5e2f2c0c7550cbd Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Tue, 25 Feb 2020 16:24:23 +0300 Subject: [PATCH] FIR2IR: correctly set type parameters of property accessors In particular, we generate different type parameters for getters & setters here. --- .../kotlin/fir/backend/ConversionUtils.kt | 29 +++- .../fir/backend/Fir2IrDeclarationStorage.kt | 85 +++++++---- .../delegatedGenericImplementation.fir.txt | 45 +++--- .../ir/irText/declarations/kt35550.fir.txt | 13 +- .../parameters/propertyAccessors.fir.txt | 138 ------------------ .../parameters/propertyAccessors.kt | 2 + .../typeParameterBeforeBound.fir.txt | 12 +- .../expressions/castToTypeParameter.fir.txt | 22 +-- .../irText/expressions/classReference.fir.txt | 10 +- .../expressions/genericPropertyCall.fir.txt | 13 +- .../expressions/genericPropertyRef.fir.txt | 48 +++--- .../implicitCastToTypeParameter.fir.txt | 15 +- .../expressions/objectClassReference.fir.txt | 5 +- .../typeParameterClassLiteral.fir.txt | 18 ++- .../expressions/useImportedMember.fir.txt | 32 ++-- ...variableAsFunctionCallWithGenerics.fir.txt | 50 ++++--- .../regressions/integerCoercionToT.fir.txt | 14 +- .../genericClassInDifferentModule_m1.fir.txt | 10 +- .../genericClassInDifferentModule_m2.fir.txt | 12 +- .../genericPropertyReferenceType.fir.txt | 22 +-- 20 files changed, 278 insertions(+), 317 deletions(-) delete mode 100644 compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index c80d825c6c5..7b128fdfcdb 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -50,25 +50,31 @@ internal fun FirElement.convertWithOffsets( internal fun createErrorType(): IrErrorType = IrErrorTypeImpl(null, emptyList(), Variance.INVARIANT) -fun FirTypeRef.toIrType(session: FirSession, declarationStorage: Fir2IrDeclarationStorage, irBuiltIns: IrBuiltIns): IrType { +fun FirTypeRef.toIrType( + session: FirSession, + declarationStorage: Fir2IrDeclarationStorage, + irBuiltIns: IrBuiltIns, + forSetter: Boolean = false +): IrType { if (this !is FirResolvedTypeRef) { return createErrorType() } - return type.toIrType(session, declarationStorage, irBuiltIns) + return type.toIrType(session, declarationStorage, irBuiltIns, forSetter = forSetter) } fun ConeKotlinType.toIrType( session: FirSession, declarationStorage: Fir2IrDeclarationStorage, irBuiltIns: IrBuiltIns, - definitelyNotNull: Boolean = false + definitelyNotNull: Boolean = false, + forSetter: Boolean = false ): IrType { return when (this) { is ConeKotlinErrorType -> createErrorType() is ConeLookupTagBasedType -> { val irSymbol = getArrayType(this.classId, irBuiltIns) ?: run { val firSymbol = this.lookupTag.toSymbol(session) ?: return createErrorType() - firSymbol.toIrSymbol(session, declarationStorage) + firSymbol.toIrSymbol(session, declarationStorage, forSetter) } // TODO: annotations IrSimpleTypeImpl( @@ -132,10 +138,14 @@ fun ConeTypeProjection.toIrTypeArgument( } } -fun FirClassifierSymbol<*>.toIrSymbol(session: FirSession, declarationStorage: Fir2IrDeclarationStorage): IrClassifierSymbol { +fun FirClassifierSymbol<*>.toIrSymbol( + session: FirSession, + declarationStorage: Fir2IrDeclarationStorage, + forSetter: Boolean = false +): IrClassifierSymbol { return when (this) { is FirTypeParameterSymbol -> { - toTypeParameterSymbol(declarationStorage) + toTypeParameterSymbol(declarationStorage, forSetter) } is FirTypeAliasSymbol -> { val typeAlias = fir @@ -178,8 +188,11 @@ fun FirClassSymbol<*>.toClassSymbol(declarationStorage: Fir2IrDeclarationStorage return declarationStorage.getIrClassSymbol(this) } -fun FirTypeParameterSymbol.toTypeParameterSymbol(declarationStorage: Fir2IrDeclarationStorage): IrTypeParameterSymbol { - return declarationStorage.getIrTypeParameterSymbol(this) +fun FirTypeParameterSymbol.toTypeParameterSymbol( + declarationStorage: Fir2IrDeclarationStorage, + forSetter: Boolean = false +): IrTypeParameterSymbol { + return declarationStorage.getIrTypeParameterSymbol(this, forSetter) } fun FirFunctionSymbol<*>.toFunctionSymbol(declarationStorage: Fir2IrDeclarationStorage): IrFunctionSymbol { 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 6307998f10e..f8d0128db7d 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 @@ -61,6 +61,8 @@ class Fir2IrDeclarationStorage( private val typeParameterCache = mutableMapOf() + private val typeParameterCacheForSetter = mutableMapOf() + private val functionCache = mutableMapOf() private val constructorCache = mutableMapOf() @@ -100,8 +102,8 @@ class Fir2IrDeclarationStorage( irSymbolTable.leaveScope(descriptor) } - private fun FirTypeRef.toIrType(session: FirSession, declarationStorage: Fir2IrDeclarationStorage) = - toIrType(session, declarationStorage, irBuiltIns) + private fun FirTypeRef.toIrType(session: FirSession, declarationStorage: Fir2IrDeclarationStorage, forSetter: Boolean = false) = + toIrType(session, declarationStorage, irBuiltIns, forSetter) private fun getIrExternalPackageFragment(fqName: FqName): IrExternalPackageFragment { return fragmentCache.getOrPut(fqName) { @@ -148,12 +150,15 @@ class Fir2IrDeclarationStorage( private fun preCacheTypeParameters(owner: FirTypeParametersOwner) { owner.typeParameters.mapIndexed { index, typeParameter -> getIrTypeParameter(typeParameter, index) + if (owner is FirProperty && owner.isVar) { + getIrTypeParameter(typeParameter, index, forSetter = true) + } } } - private fun IrTypeParametersContainer.setTypeParameters(owner: FirTypeParametersOwner) { + private fun IrTypeParametersContainer.setTypeParameters(owner: FirTypeParametersOwner, forSetter: Boolean = false) { typeParameters = owner.typeParameters.mapIndexed { index, typeParameter -> - getIrTypeParameter(typeParameter, index).apply { parent = this@setTypeParameters } + getIrTypeParameter(typeParameter, index, forSetter).apply { parent = this@setTypeParameters } } } @@ -323,9 +328,25 @@ class Fir2IrDeclarationStorage( }.declareSupertypesAndTypeParameters(anonymousObject) } - // TODO: change index default to -1 - private fun getIrTypeParameter(typeParameter: FirTypeParameter, index: Int = 0): IrTypeParameter { - return typeParameterCache[typeParameter] ?: typeParameter.run { + private fun getIrTypeParameter(typeParameter: FirTypeParameter, index: Int = -1, forSetter: Boolean = false): IrTypeParameter { + // Here transformation is a bit difficult because one FIR property type parameter + // can be transformed to two different type parameters: one for getter and another one for setter + val simpleCachedParameter = typeParameterCache[typeParameter] + if (simpleCachedParameter != null) { + if (!forSetter) { + return simpleCachedParameter + } + if (index < 0) { + val parent = simpleCachedParameter.parent + if (parent !is IrSimpleFunction || parent.returnType == unitType) { + return simpleCachedParameter + } + } + } + if (forSetter) { + typeParameterCacheForSetter[typeParameter]?.let { return it } + } + return typeParameter.run { // Yet I don't want to enable this requirement because it breaks some tests // However, if we get here it *should* mean that type parameter index is given explicitly // At this moment (20.02.2020) this requirement breaks 11/355 Fir2IrText tests @@ -337,7 +358,7 @@ class Fir2IrDeclarationStorage( irSymbolTable.declareGlobalTypeParameter(startOffset, endOffset, origin, descriptor) { symbol -> IrTypeParameterImpl( startOffset, endOffset, origin, symbol, - name, index, + name, if (index < 0) 0 else index, isReified, variance ).apply { @@ -347,7 +368,11 @@ class Fir2IrDeclarationStorage( } // Cache the type parameter BEFORE processing its bounds/supertypes, to properly handle recursive type bounds. - typeParameterCache[typeParameter] = irTypeParameter + if (forSetter) { + typeParameterCacheForSetter[typeParameter] = irTypeParameter + } else { + typeParameterCache[typeParameter] = irTypeParameter + } bounds.mapTo(irTypeParameter.superTypes) { it.toIrType(session, this@Fir2IrDeclarationStorage) } irTypeParameter } @@ -419,14 +444,18 @@ class Fir2IrDeclarationStorage( if (function is FirSimpleFunction) { setTypeParameters(function) } + val forSetter = function is FirPropertyAccessor && function.isSetter if (function is FirDefaultPropertySetter) { - val type = function.valueParameters.first().returnTypeRef.toIrType(session, this@Fir2IrDeclarationStorage) + val type = function.valueParameters.first().returnTypeRef.toIrType( + session, this@Fir2IrDeclarationStorage, forSetter = true + ) declareDefaultSetterParameter(type) } else if (function != null) { valueParameters = function.valueParameters.mapIndexed { index, valueParameter -> createAndSaveIrParameter( valueParameter, index, - useStubForDefaultValueStub = function !is FirConstructor || containingClass?.name != Name.identifier("Enum") + useStubForDefaultValueStub = function !is FirConstructor || containingClass?.name != Name.identifier("Enum"), + forSetter = forSetter ).apply { this.parent = parent } @@ -439,7 +468,7 @@ class Fir2IrDeclarationStorage( extensionReceiverParameter = receiverTypeRef.convertWithOffsets { startOffset, endOffset -> declareThisReceiverParameter( parent, - thisType = receiverTypeRef.toIrType(session, this@Fir2IrDeclarationStorage), + thisType = receiverTypeRef.toIrType(session, this@Fir2IrDeclarationStorage, forSetter), thisOrigin = thisOrigin, startOffset = startOffset, endOffset = endOffset @@ -593,14 +622,14 @@ class Fir2IrDeclarationStorage( private fun createIrPropertyAccessor( propertyAccessor: FirPropertyAccessor?, + property: FirProperty, correspondingProperty: IrProperty, propertyType: IrType, irParent: IrDeclarationParent?, isSetter: Boolean, origin: IrDeclarationOrigin, startOffset: Int, - endOffset: Int, - correspondingPropertyReceiverTypeRef: FirTypeRef? + endOffset: Int ): IrSimpleFunction { val propertyDescriptor = correspondingProperty.descriptor val descriptor = @@ -623,12 +652,15 @@ class Fir2IrDeclarationStorage( isFakeOverride = origin == IrDeclarationOrigin.FAKE_OVERRIDE, isOperator = false ).apply { + setTypeParameters(property, forSetter = isSetter) if (propertyAccessor == null && isSetter) { - declareDefaultSetterParameter(propertyType) + declareDefaultSetterParameter( + property.returnTypeRef.toIrType(session, this@Fir2IrDeclarationStorage, forSetter = true) + ) } }.bindAndDeclareParameters( propertyAccessor, descriptor, irParent, isStatic = irParent !is IrClass, shouldLeaveScope = true, - parentPropertyReceiverType = correspondingPropertyReceiverTypeRef + parentPropertyReceiverType = property.receiverTypeRef ).apply { if (irParent != null) { parent = irParent @@ -705,26 +737,24 @@ class Fir2IrDeclarationStorage( ).apply { descriptor.bind(this) val type = property.returnTypeRef.toIrType(session, this@Fir2IrDeclarationStorage) - val receiverType = property.receiverTypeRef getter = createIrPropertyAccessor( - property.getter, this, type, irParent, false, + property.getter, property, this, type, irParent, false, when { property.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR property.getter is FirDefaultPropertyGetter -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR else -> origin }, - startOffset, endOffset, correspondingPropertyReceiverTypeRef = receiverType + startOffset, endOffset ) if (property.isVar) { setter = createIrPropertyAccessor( - property.setter, this, type, irParent, true, + property.setter, property, this, type, irParent, true, when { property.delegate != null -> IrDeclarationOrigin.DELEGATED_PROPERTY_ACCESSOR property.setter is FirDefaultPropertySetter -> IrDeclarationOrigin.DEFAULT_PROPERTY_ACCESSOR else -> origin }, - startOffset, endOffset, - correspondingPropertyReceiverTypeRef = receiverType + startOffset, endOffset ) } } @@ -763,7 +793,8 @@ class Fir2IrDeclarationStorage( private fun createAndSaveIrParameter( valueParameter: FirValueParameter, index: Int = -1, - useStubForDefaultValueStub: Boolean = true + useStubForDefaultValueStub: Boolean = true, + forSetter: Boolean = false ): IrValueParameter { val descriptor = WrappedValueParameterDescriptor() val origin = IrDeclarationOrigin.DEFINED @@ -776,7 +807,9 @@ class Fir2IrDeclarationStorage( startOffset, endOffset, origin, symbol, valueParameter.name, index, type, if (!valueParameter.isVararg) null - else valueParameter.returnTypeRef.coneTypeSafe()?.arrayElementType(session)?.toIrType(session, this, irBuiltIns), + else valueParameter.returnTypeRef.coneTypeSafe()?.arrayElementType(session)?.toIrType( + session, this, irBuiltIns, forSetter + ), valueParameter.isCrossinline, valueParameter.isNoinline ).apply { descriptor.bind(this) @@ -856,8 +889,8 @@ class Fir2IrDeclarationStorage( return irSymbolTable.referenceClass(irClass.descriptor) } - fun getIrTypeParameterSymbol(firTypeParameterSymbol: FirTypeParameterSymbol): IrTypeParameterSymbol { - val irTypeParameter = getIrTypeParameter(firTypeParameterSymbol.fir) + fun getIrTypeParameterSymbol(firTypeParameterSymbol: FirTypeParameterSymbol, forSetter: Boolean): IrTypeParameterSymbol { + val irTypeParameter = getIrTypeParameter(firTypeParameterSymbol.fir, forSetter = forSetter) return irSymbolTable.referenceTypeParameter(irTypeParameter.descriptor) } diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt index 5e80651c849..6753400c12f 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt @@ -8,20 +8,23 @@ 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>, $receiver:C of ) returnType:kotlin.collections.Map.IBase, C of >? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:C of .IBase.) returnType:kotlin.collections.Map.IBase, C of .IBase.>? correspondingProperty: PROPERTY name:id visibility:public modality:ABSTRACT [val] + TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:C of + $receiver: VALUE_PARAMETER name: type:C of .IBase. PROPERTY name:x visibility:public modality:ABSTRACT [var] - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT <> ($this:.IBase.IBase>, $receiver:kotlin.collections.List>) returnType:D of ? + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>) returnType:D of .IBase.? correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.IBase.IBase> - $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 + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.IBase.IBase>, $receiver:kotlin.collections.List.IBase.>, :D of .IBase.?) returnType:kotlin.Unit correspondingProperty: PROPERTY name:x visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.IBase.IBase> - $receiver: VALUE_PARAMETER name: type:kotlin.collections.List> - VALUE_PARAMETER name: index:0 type:D of ? + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.IBase.> + VALUE_PARAMETER name: index:0 type:D of .IBase.? 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 @@ -51,23 +54,23 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt VALUE_PARAMETER name:a index:0 type:E of .Test1 VALUE_PARAMETER name:b index:1 type:B of .Test1.foo PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test1.Test1>) returnType:kotlin.collections.Map.Test1, C of >? [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test1.Test1>) returnType:kotlin.collections.Map.Test1, C of .IBase.>? [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val] overridden: - public abstract fun (): kotlin.collections.Map.IBase, C of >? declared in .IBase + public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase $this: VALUE_PARAMETER name: type:.Test1.Test1> PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test1.Test1>) returnType:D of ? [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test1.Test1>) returnType:D of .IBase.? [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] overridden: - public abstract fun (): D of ? declared in .IBase + public abstract fun (): D of .IBase.? declared in .IBase $this: VALUE_PARAMETER name: type:.Test1.Test1> - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test1.Test1>, :D of ?) returnType:kotlin.Unit [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test1.Test1>, :D of .IBase.?) returnType:kotlin.Unit [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] overridden: - public abstract fun (: D of ?): kotlin.Unit declared in .IBase + public abstract fun (: D of .IBase.?): kotlin.Unit declared in .IBase $this: VALUE_PARAMETER name: type:.Test1.Test1> - VALUE_PARAMETER name: index:0 type:D of ? + VALUE_PARAMETER name: index:0 type:D of .IBase.? 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 @@ -115,23 +118,23 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt VALUE_PARAMETER name:a index:0 type:kotlin.String VALUE_PARAMETER name:b index:1 type:B of .Test2.foo PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.collections.Map>? [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:kotlin.collections.Map.IBase.>? [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:ABSTRACT [fake_override,val] overridden: - public abstract fun (): kotlin.collections.Map.IBase, C of >? declared in .IBase + public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase $this: VALUE_PARAMETER name: type:.Test2 PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:D of ? [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2) returnType:D of .IBase.? [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] overridden: - public abstract fun (): D of ? declared in .IBase + public abstract fun (): D of .IBase.? declared in .IBase $this: VALUE_PARAMETER name: type:.Test2 - FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2, :D of ?) returnType:kotlin.Unit [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:ABSTRACT <> ($this:.Test2, :D of .IBase.?) returnType:kotlin.Unit [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:x visibility:public modality:ABSTRACT [fake_override,var] overridden: - public abstract fun (: D of ?): kotlin.Unit declared in .IBase + public abstract fun (: D of .IBase.?): kotlin.Unit declared in .IBase $this: VALUE_PARAMETER name: type:.Test2 - VALUE_PARAMETER name: index:0 type:D of ? + VALUE_PARAMETER name: index:0 type:D of .IBase.? 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 diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.txt index 2e28fd7cb84..6e3b9f7d4d0 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.txt @@ -2,13 +2,14 @@ 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, $receiver:T of ) returnType:T of + FUN name: visibility:public modality:OPEN ($this:.I, $receiver:T of .I.) returnType:T of .I. correspondingProperty: PROPERTY name:id visibility:public modality:OPEN [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.I - $receiver: VALUE_PARAMETER name: type:T of + $receiver: VALUE_PARAMETER name: type:T of .I. 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 + RETURN type=kotlin.Nothing from='public open fun (): T of .I. declared in .I' + ERROR_CALL 'Unresolved reference: this@R|/I.id|' type=T of .I. 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 @@ -30,10 +31,10 @@ FILE fqName: fileName:/kt35550.kt DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I]' PROPERTY FAKE_OVERRIDE name:id visibility:public modality:OPEN [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.A) returnType:T of [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.A) returnType:T of .I. [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:id visibility:public modality:OPEN [fake_override,val] overridden: - public open fun (): T of declared in .I + public open fun (): T of .I. declared in .I $this: VALUE_PARAMETER name: type:.A FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: diff --git a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt deleted file mode 100644 index 73dc03435f4..00000000000 --- a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.fir.txt +++ /dev/null @@ -1,138 +0,0 @@ -FILE fqName: fileName:/propertyAccessors.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 - PROPERTY name:testExt1 visibility:public modality:FINAL [val] - 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 <> ($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 <> ($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 <> ($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 <> ($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 <> ($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] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Host> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] - CONSTRUCTOR visibility:public <> () returnType:.Host.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:testMem1 visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:testMem1 visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Host.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:testMem2 visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL <> ($this:.Host.Host>) returnType:kotlin.Int - correspondingProperty: PROPERTY name:testMem2 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Host.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.Host>, value:kotlin.Int) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:testMem2 visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Host.Host> - 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>, $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>, $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>, $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>, $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>, $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>, $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] - 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/parameters/propertyAccessors.kt b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt index 819253f0b46..a0df3c1f0f9 100644 --- a/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt +++ b/compiler/testData/ir/irText/declarations/parameters/propertyAccessors.kt @@ -1,3 +1,5 @@ +// FIR_IDENTICAL + val test1 get() = 42 var test2 get() = 42; set(value) {} diff --git a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt index e7145076ebb..aaa17e273de 100644 --- a/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/typeParameterBeforeBound.fir.txt @@ -25,12 +25,16 @@ 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 <> ($receiver:.Test1, U of >) 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 > + TYPE_PARAMETER name:T index:0 variance: superTypes:[U of .] + TYPE_PARAMETER name:U index:0 variance: superTypes:[kotlin.Any?] + $receiver: VALUE_PARAMETER name: type:.Test1., U of .> BLOCK_BODY - FUN name: visibility:public modality:FINAL <> ($receiver:.Test1, U of >, 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 > + TYPE_PARAMETER name:T index:0 variance: superTypes:[U of .] + TYPE_PARAMETER name:U index:1 variance: superTypes:[kotlin.Any?] + $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/expressions/castToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt index 8feb72aa90b..33b90c0ac50 100644 --- a/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt +++ b/compiler/testData/ir/irText/expressions/castToTypeParameter.fir.txt @@ -14,13 +14,14 @@ 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 <> ($receiver:T of ) 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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $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 - ERROR_CALL 'Unresolved reference: this@R|/castExtVal|' type=T of + RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' + TYPE_OP type=T of . origin=CAST typeOperand=T of . + ERROR_CALL 'Unresolved reference: this@R|/castExtVal|' type=T of . CLASS CLASS name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host.Host> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] @@ -68,14 +69,15 @@ FILE fqName: fileName:/castToTypeParameter.kt 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>, $receiver:TV of ) returnType:TV of + FUN name: visibility:public modality:FINAL ($this:.Host.Host>, $receiver:TV of .Host.) returnType:TV of .Host. correspondingProperty: PROPERTY name:castGenericMemberExtVal visibility:public modality:FINAL [val] + TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.Host.Host> - $receiver: VALUE_PARAMETER name: type:TV of + $receiver: VALUE_PARAMETER name: type:TV of .Host. 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 - ERROR_CALL 'Unresolved reference: this@R|/Host.castGenericMemberExtVal|' type=TV of + RETURN type=kotlin.Nothing from='public final fun (): TV of .Host. declared in .Host' + TYPE_OP type=TV of .Host. origin=CAST typeOperand=TV of .Host. + ERROR_CALL 'Unresolved reference: this@R|/Host.castGenericMemberExtVal|' type=TV of .Host. 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 diff --git a/compiler/testData/ir/irText/expressions/classReference.fir.txt b/compiler/testData/ir/irText/expressions/classReference.fir.txt index 7050f78d46b..15469735de3 100644 --- a/compiler/testData/ir/irText/expressions/classReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/classReference.fir.txt @@ -24,5 +24,11 @@ FILE fqName: fileName:/classReference.kt GET_OBJECT 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit GET_CLASS type=kotlin.reflect.KClass<.A> CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null - ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=java.lang.Class<.A> - ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=java.lang.Class<.A> + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=null + : .A + $receiver: GET_CLASS type=kotlin.reflect.KClass<.A> + GET_OBJECT 'CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=null + : .A + $receiver: GET_CLASS type=kotlin.reflect.KClass<.A> + CONSTRUCTOR_CALL 'public constructor () [primary] declared in .A' type=.A origin=null diff --git a/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt b/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt index 51c5b31aa5d..4c74236c178 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyCall.fir.txt @@ -1,15 +1,18 @@ FILE fqName: fileName:/genericPropertyCall.kt PROPERTY name:id visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:T of ) 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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $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 + RETURN type=kotlin.Nothing from='public final fun (): T of . declared in ' + ERROR_CALL 'Unresolved reference: this@R|/id|' type=T of . PROPERTY name:test visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test type:kotlin.String visibility:private [final,static] EXPRESSION_BODY - ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=kotlin.String + CALL 'public final fun (): T of . declared in ' type=kotlin.String origin=null + : kotlin.String + $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 ccbe47c4911..900caba5573 100644 --- a/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt +++ b/compiler/testData/ir/irText/expressions/genericPropertyRef.fir.txt @@ -68,30 +68,32 @@ FILE fqName: fileName:/genericPropertyRef.kt FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final text: kotlin.String? [var]' field='FIELD PROPERTY_BACKING_FIELD name:text type:kotlin.String? visibility:private' getter='public final fun (): kotlin.String? declared in .Value' setter='public final fun (: kotlin.String?): kotlin.Unit declared in .Value' type=kotlin.reflect.KMutableProperty1<.Value>, kotlin.String?> origin=null - FUN DELEGATED_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($receiver:.Value>) returnType:kotlin.Int + 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 ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalText visibility:public modality:FINAL [delegated,val] - $receiver: VALUE_PARAMETER name: type:.Value> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $receiver: VALUE_PARAMETER name: type:.Value.> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + 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 $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=GET_PROPERTY - t: ERROR_CALL 'Unresolved reference: this@R|/additionalText|' type=.Value> - p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + t: ERROR_CALL 'Unresolved reference: this@R|/additionalText|' type=.Value.> + p: PROPERTY_REFERENCE 'public final additionalText: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalText$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor (kmember: kotlin.Any) [primary] declared in .DVal' type=.DVal origin=null - kmember: PROPERTY_REFERENCE 'public final value: T of [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 <> ($receiver:.Value>) returnType:kotlin.Int + 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 ($receiver:.Value.>) returnType:kotlin.Int correspondingProperty: PROPERTY name:additionalValue visibility:public modality:FINAL [delegated,val] - $receiver: VALUE_PARAMETER name: type:.Value> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $receiver: VALUE_PARAMETER name: type:.Value.> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in ' + 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 $this: GET_FIELD 'FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' type=.DVal origin=GET_PROPERTY - t: ERROR_CALL 'Unresolved reference: this@R|/additionalValue|' type=.Value> - p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null + t: ERROR_CALL 'Unresolved reference: this@R|/additionalValue|' type=.Value.> + p: PROPERTY_REFERENCE 'public final additionalValue: kotlin.Int [delegated,val]' field='FIELD PROPERTY_DELEGATE name:additionalValue$delegate type:.DVal visibility:private [final,static]' getter='public final fun (): kotlin.Int declared in ' setter=null type=kotlin.reflect.KProperty<*> origin=null CLASS CLASS name:DVal modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DVal CONSTRUCTOR visibility:public <> (kmember:kotlin.Any) returnType:.DVal [primary] @@ -161,25 +163,27 @@ 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 <> ($receiver:T of ) 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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $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 <> ($receiver:T of , value:T of ) returnType:kotlin.Unit + 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 ($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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $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 - value: ERROR_CALL 'Unresolved reference: this@R|/bar|' type=T of + value: ERROR_CALL 'Unresolved reference: this@R|/bar|' type=T of . SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value2 type:kotlin.Any? visibility:private [static]' type=kotlin.Unit origin=null - value: GET_VAR 'value: T of declared in .' type=T of origin=null + value: GET_VAR 'value: T of . declared in .' type=T of . origin=null PROPERTY name:barRef visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:barRef type:kotlin.reflect.KMutableProperty1 visibility:private [final,static] EXPRESSION_BODY - PROPERTY_REFERENCE 'public final bar: T of [var]' field=null getter='public final fun (): T of declared in ' setter='public final fun (value: T of ): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null + PROPERTY_REFERENCE 'public final bar: T of . [var]' field=null getter='public final fun (): T of . declared in ' setter='public final fun (value: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty1 origin=null FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:kotlin.reflect.KMutableProperty1 correspondingProperty: PROPERTY name:barRef visibility:public modality:FINAL [val] BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt index 29da7e71bc2..da5d737f95d 100644 --- a/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt +++ b/compiler/testData/ir/irText/expressions/implicitCastToTypeParameter.fir.txt @@ -29,16 +29,17 @@ 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 <> ($receiver:.Foo>) 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> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] + $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 + RETURN type=kotlin.Nothing from='public final fun (): T of .? declared in ' + WHEN type=T of .? origin=IF BRANCH - if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of - ERROR_CALL 'Unresolved reference: this@R|/asT|' type=.Foo> - then: ERROR_CALL 'Unresolved reference: this@R|/asT|' type=T of + if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=T of . + ERROR_CALL 'Unresolved reference: this@R|/asT|' type=.Foo.> + then: ERROR_CALL 'Unresolved reference: this@R|/asT|' type=T of . BRANCH if: CONST Boolean type=kotlin.Boolean value=true then: CONST Null type=kotlin.Nothing? value=null diff --git a/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt b/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt index c7bdd8b39c7..31cbfde2536 100644 --- a/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt +++ b/compiler/testData/ir/irText/expressions/objectClassReference.fir.txt @@ -22,4 +22,7 @@ FILE fqName: fileName:/objectClassReference.kt BLOCK_BODY GET_CLASS type=kotlin.reflect.KClass<.A> GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=java.lang.Class<.A> + CALL 'public final fun (): java.lang.Class> declared in kotlin.jvm' type=java.lang.Class<.A> origin=null + : .A + $receiver: GET_CLASS type=kotlin.reflect.KClass<.A> + GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A diff --git a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt index 5e305284baf..41cc21e4c34 100644 --- a/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt +++ b/compiler/testData/ir/irText/expressions/typeParameterClassLiteral.fir.txt @@ -11,12 +11,13 @@ 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 <> ($receiver:T of ) 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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any] + $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> + 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.> 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] @@ -37,13 +38,14 @@ 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, $receiver:TV of ) returnType:kotlin.reflect.KClass> + FUN name: visibility:public modality:FINAL ($this:.Host, $receiver:TV of .Host.) returnType:kotlin.reflect.KClass.Host.> correspondingProperty: PROPERTY name:classRefGenericMemberExtVal visibility:public modality:FINAL [val] + TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any] $this: VALUE_PARAMETER name: type:.Host - $receiver: VALUE_PARAMETER name: type:TV of + $receiver: VALUE_PARAMETER name: type:TV of .Host. 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> + RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass.Host.> declared in .Host' + CLASS_REFERENCE 'TYPE_PARAMETER name:TV index:0 variance: superTypes:[kotlin.Any]' type=kotlin.reflect.KClass.Host.> 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 diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt index 986613a24fe..dd98f6af58c 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt @@ -35,13 +35,14 @@ 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, $receiver:T of ) returnType:T of + FUN name: visibility:public modality:FINAL ($this:.BaseClass, $receiver:T of .BaseClass.) returnType:T of .BaseClass. correspondingProperty: PROPERTY name:fromClass visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.BaseClass - $receiver: VALUE_PARAMETER name: type:T of + $receiver: VALUE_PARAMETER name: type:T of .BaseClass. 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 + RETURN type=kotlin.Nothing from='public final fun (): T of .BaseClass. declared in .BaseClass' + ERROR_CALL 'Unresolved reference: this@R|/BaseClass.fromClass|' type=T of .BaseClass. 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 @@ -114,18 +115,19 @@ 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, $receiver:T of ) returnType:T of + FUN name: visibility:public modality:FINAL ($this:.C, $receiver:T of .C.) returnType:T of .C. correspondingProperty: PROPERTY name:g2 visibility:public modality:FINAL [val] + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.C - $receiver: VALUE_PARAMETER name: type:T of + $receiver: VALUE_PARAMETER name: type:T of .C. 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 + RETURN type=kotlin.Nothing from='public final fun (): T of .C. declared in .C' + ERROR_CALL 'Unresolved reference: this@R|/C.g2|' type=T of .C. PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [fake_override,val] - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C) returnType:T of [fake_override] + FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.C) returnType:T of .BaseClass. [fake_override] correspondingProperty: PROPERTY FAKE_OVERRIDE name:fromClass visibility:public modality:FINAL [fake_override,val] overridden: - public final fun (): T of declared in .BaseClass + public final fun (): T of .BaseClass. declared in .BaseClass $this: VALUE_PARAMETER name: type:.C FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -229,7 +231,10 @@ FILE fqName: fileName:/useImportedMember.kt BRANCH if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=kotlin.String + arg0: CALL 'public final fun (): T of .C. declared in .C' type=kotlin.String origin=null + : kotlin.String + $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" @@ -248,7 +253,10 @@ FILE fqName: fileName:/useImportedMember.kt BRANCH if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=kotlin.String + arg0: CALL 'public final fun (): T of .BaseClass. declared in .BaseClass' type=kotlin.String origin=null + : kotlin.String + $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 059d4779046..8b82c1b268f 100644 --- a/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt +++ b/compiler/testData/ir/irText/expressions/variableAsFunctionCallWithGenerics.fir.txt @@ -1,34 +1,40 @@ FILE fqName: fileName:/variableAsFunctionCallWithGenerics.kt PROPERTY name:gk visibility:public modality:FINAL [val] - FUN name: visibility:public modality:FINAL <> ($receiver:T of ) 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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.CharSequence] + $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 - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:T of + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0.> declared in ' + FUN_EXPR type=kotlin.Function0.> origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:T of . BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): T of declared in .' - ERROR_CALL 'Unresolved reference: this@R|/gk|' type=T of - FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:T of + RETURN type=kotlin.Nothing from='local final fun (): T of . declared in .' + ERROR_CALL 'Unresolved reference: this@R|/gk|' type=T of . + FUN name:testGeneric1 visibility:public modality:FINAL <> (x:kotlin.String) returnType:T of . VALUE_PARAMETER name:x index:0 type:kotlin.String BLOCK_BODY - 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: ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=kotlin.Function0 + 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 + : kotlin.String + $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 <> ($receiver:T of ) 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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $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 - FUN name: visibility:local modality:FINAL <> () returnType:T of + RETURN type=kotlin.Nothing from='public final fun (): kotlin.Function0.> declared in ' + FUN_EXPR type=kotlin.Function0.> origin=LAMBDA + FUN name: visibility:local modality:FINAL <> () returnType:T of . BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): T of declared in .' - ERROR_CALL 'Unresolved reference: this@R|/kt26531Val|' type=T of - FUN name:kt26531 visibility:public modality:FINAL <> () returnType:T of + RETURN type=kotlin.Nothing from='local final fun (): T of . declared in .' + ERROR_CALL 'Unresolved reference: this@R|/kt26531Val|' type=T of . + FUN name:kt26531 visibility:public modality:FINAL <> () returnType:T of . BLOCK_BODY - 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: ERROR_EXPR 'Cannot bind 1 type arguments to call with 0 type parameters' type=kotlin.Function0 + 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 + : kotlin.Int + $receiver: CONST Int type=kotlin.Int value=7 diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt index 12306d81336..3a8ae2ef86e 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.txt @@ -41,16 +41,18 @@ 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 <> ($receiver:.CInt32VarX>) 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> + TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int] + $receiver: VALUE_PARAMETER name: type:.CInt32VarX.> BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T_INT of declared in ' + 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 <> ($receiver:.CInt32VarX>, 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 + TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int] + $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] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdType diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt index 125c058150d..550fbf0e573 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m1.fir.txt @@ -31,14 +31,16 @@ 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>, $receiver:Z of ) returnType:T of .Base + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.Base.Base>, $receiver:Z of .Base.) returnType:T of .Base correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:Z index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.Base.Base> - $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 + $receiver: VALUE_PARAMETER name: type:Z of .Base. + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:ABSTRACT ($this:.Base.Base>, $receiver:Z of .Base., :T of .Base) returnType:kotlin.Unit correspondingProperty: PROPERTY name:exn visibility:public modality:ABSTRACT [var] + TYPE_PARAMETER name:Z index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.Base.Base> - $receiver: VALUE_PARAMETER name: type:Z of + $receiver: VALUE_PARAMETER name: type:Z of .Base. 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 5f358059b6e..b7dead5c4ad 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt @@ -37,18 +37,20 @@ 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>, $receiver:Z of ) returnType:T of .Derived1 + FUN name: visibility:public modality:FINAL ($this:.Derived1.Derived1>, $receiver:Z of .Derived1.) returnType:T of .Derived1 correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var] + TYPE_PARAMETER name:Z index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.Derived1.Derived1> - $receiver: VALUE_PARAMETER name: type:Z of + $receiver: VALUE_PARAMETER name: type:Z of .Derived1. BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Derived1 declared in .Derived1' + 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>, $receiver:Z of , value:T of .Derived1) returnType:kotlin.Unit + FUN name: visibility:public modality:FINAL ($this:.Derived1.Derived1>, $receiver:Z of .Derived1., value:T of .Derived1) returnType:kotlin.Unit correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var] + TYPE_PARAMETER name:Z index:0 variance: superTypes:[kotlin.Any?] $this: VALUE_PARAMETER name: type:.Derived1.Derived1> - $receiver: VALUE_PARAMETER name: type:Z of + $receiver: VALUE_PARAMETER name: type:Z of .Derived1. 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/types/genericPropertyReferenceType.fir.txt b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt index c1faeaf4dd8..9d8f52d0c7a 100644 --- a/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt +++ b/compiler/testData/ir/irText/types/genericPropertyReferenceType.fir.txt @@ -40,17 +40,19 @@ 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 <> ($receiver:.C>) 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> + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $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 <> ($receiver:.C>, v:T of ) returnType:kotlin.Unit + 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 ($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 + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $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 FUN name:use visibility:public modality:FINAL <> (p:kotlin.reflect.KMutableProperty) returnType:kotlin.Unit @@ -59,11 +61,11 @@ FILE fqName: fileName:/genericPropertyReferenceType.kt FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun use (p: kotlin.reflect.KMutableProperty): kotlin.Unit declared in ' type=kotlin.Unit origin=null - p: PROPERTY_REFERENCE 'public final y: T of [var]' field=null getter='public final fun (): T of declared in ' setter='public final fun (v: T of ): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + p: PROPERTY_REFERENCE 'public final y: T of . [var]' field=null getter='public final fun (): T of . declared in ' setter='public final fun (v: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY TYPE_OP type=.C origin=CAST typeOperand=.C GET_VAR 'a: kotlin.Any declared in .test2' type=kotlin.Any origin=null CALL 'public final fun use (p: kotlin.reflect.KMutableProperty): kotlin.Unit declared in ' type=kotlin.Unit origin=null - p: PROPERTY_REFERENCE 'public final y: T of [var]' field=null getter='public final fun (): T of declared in ' setter='public final fun (v: T of ): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null + p: PROPERTY_REFERENCE 'public final y: T of . [var]' field=null getter='public final fun (): T of . declared in ' setter='public final fun (v: T of .): kotlin.Unit declared in ' type=kotlin.reflect.KMutableProperty0 origin=null