diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt index 550909136b8..16e65d121e8 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt @@ -25,21 +25,24 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl import org.jetbrains.kotlin.ir.declarations.impl.IrPropertyImpl +import org.jetbrains.kotlin.ir.declarations.impl.IrTypeParameterImpl import org.jetbrains.kotlin.ir.declarations.impl.IrValueParameterImpl import org.jetbrains.kotlin.ir.descriptors.WrappedPropertyDescriptor import org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor +import org.jetbrains.kotlin.ir.descriptors.WrappedTypeParameterDescriptor import org.jetbrains.kotlin.ir.descriptors.WrappedValueParameterDescriptor import org.jetbrains.kotlin.ir.expressions.impl.* -import org.jetbrains.kotlin.ir.types.classOrNull +import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol +import org.jetbrains.kotlin.ir.types.* import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl -import org.jetbrains.kotlin.ir.types.isNothing -import org.jetbrains.kotlin.ir.types.isUnit +import org.jetbrains.kotlin.ir.types.impl.makeTypeProjection import org.jetbrains.kotlin.ir.util.classId import org.jetbrains.kotlin.ir.util.defaultType import org.jetbrains.kotlin.ir.util.hasAnnotation import org.jetbrains.kotlin.ir.util.isFakeOverride import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.Variance /** * A generator for delegated members from implementation by delegation. @@ -105,6 +108,12 @@ internal class DelegatedMemberGenerator( val descriptor = WrappedSimpleFunctionDescriptor() val origin = IrDeclarationOrigin.DELEGATED_MEMBER val modality = if (superFunction.modality == Modality.ABSTRACT) Modality.OPEN else superFunction.modality + // TODO: external classes, as the type parameters are converted using deserialized descriptors when used inside the classes. + val addTypeSubstitution = irField.type.classOrNull?.owner?.origin?.let { + it != IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB + && it != IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB + } == true + lateinit var irTypeSubstitutor: IrTypeSubstitutor val delegateFunction = symbolTable.declareSimpleFunction(descriptor) { symbol -> IrFunctionImpl( startOffset, @@ -127,15 +136,48 @@ internal class DelegatedMemberGenerator( this.parent = subClass overriddenSymbols = listOf(superFunction.symbol) dispatchReceiverParameter = declareThisReceiverParameter(symbolTable, subClass.defaultType, origin) - // TODO: type parameters from superFunctions and type substitution when super interface types are generic + if (addTypeSubstitution) { + val substParameters = mutableListOf() + val substArguments = mutableListOf() + initializeTypeSubstitution(substParameters, substArguments, irField.type) + superFunction.typeParameters.forEach { typeParameter -> + val parameterDescriptor = WrappedTypeParameterDescriptor() + typeParameters += symbolTable.declareScopedTypeParameter( + startOffset, endOffset, origin, parameterDescriptor + ) { symbol -> + IrTypeParameterImpl( + startOffset, + endOffset, + origin, + symbol, + typeParameter.name, + typeParameter.index, + typeParameter.isReified, + typeParameter.variance + ).also { + parameterDescriptor.bind(it) + it.parent = this + substParameters.add(typeParameter.symbol) + substArguments.add( + makeTypeProjection( + variance = Variance.INVARIANT, + type = IrSimpleTypeImpl(it.symbol, false, emptyList(), emptyList()) + ) + ) + } + } + } + irTypeSubstitutor = IrTypeSubstitutor(substParameters, substArguments, irBuiltIns) + } superFunction.valueParameters.forEach { valueParameter -> val parameterDescriptor = WrappedValueParameterDescriptor() + val substedType = if (addTypeSubstitution) irTypeSubstitutor.substitute(valueParameter.type) else valueParameter.type valueParameters += symbolTable.declareValueParameter( - startOffset, endOffset, origin, parameterDescriptor, valueParameter.type + startOffset, endOffset, origin, parameterDescriptor, substedType ) { symbol -> IrValueParameterImpl( startOffset, endOffset, origin, symbol, - valueParameter.name, valueParameter.index, valueParameter.type, + valueParameter.name, valueParameter.index, substedType, null, valueParameter.isCrossinline, valueParameter.isNoinline ).also { parameterDescriptor.bind(it) @@ -177,7 +219,7 @@ internal class DelegatedMemberGenerator( val irCall = IrCallImpl( startOffset, endOffset, - superFunction.returnType, + if (addTypeSubstitution) irTypeSubstitutor.substitute(superFunction.returnType) else superFunction.returnType, superFunction.symbol, superFunction.typeParameters.size, superFunction.valueParameters.size @@ -211,6 +253,20 @@ internal class DelegatedMemberGenerator( return delegateFunction } + private fun initializeTypeSubstitution( + typeParameters: MutableList, + typeArguments: MutableList, + type: IrType + ) { + if (type is IrSimpleTypeImpl && type.arguments.isNotEmpty()) { + val classTypeParameters = type.classOrNull?.owner?.typeParameters + if (classTypeParameters?.size == type.arguments.size) { + typeParameters.addAll(classTypeParameters.map { it.symbol }) + typeArguments.addAll(type.arguments) + } + } + } + private fun generateDelegatedProperty( subClass: IrClass, irField: IrField, diff --git a/compiler/testData/codegen/box/classes/delegationGenericArg.kt b/compiler/testData/codegen/box/classes/delegationGenericArg.kt index 86ab6a11cc7..f298e834f79 100644 --- a/compiler/testData/codegen/box/classes/delegationGenericArg.kt +++ b/compiler/testData/codegen/box/classes/delegationGenericArg.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { fun foo(t: T): String } diff --git a/compiler/testData/codegen/box/classes/delegationGenericArgUpperBound.kt b/compiler/testData/codegen/box/classes/delegationGenericArgUpperBound.kt index 577edda2528..72e541b7f3b 100644 --- a/compiler/testData/codegen/box/classes/delegationGenericArgUpperBound.kt +++ b/compiler/testData/codegen/box/classes/delegationGenericArgUpperBound.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { fun foo(t: T): String } diff --git a/compiler/testData/codegen/box/classes/delegationGenericLongArg.kt b/compiler/testData/codegen/box/classes/delegationGenericLongArg.kt index 9ea8e639590..8bd117f9fa1 100644 --- a/compiler/testData/codegen/box/classes/delegationGenericLongArg.kt +++ b/compiler/testData/codegen/box/classes/delegationGenericLongArg.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR interface A { fun foo(t: T, u: U): String } diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt index a8d21428d01..007a5c5ca47 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt @@ -49,55 +49,59 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt SET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:local [final]' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .Test1.Test1> declared in .Test1' type=.Test1.Test1> origin=null value: GET_VAR 'i: .IBase.Test1> declared in .Test1.' type=.IBase.Test1> origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test1.Test1>, a:A of .IBase, b:B of .IBase.foo) returnType:kotlin.Unit + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test1.Test1>, a:E of .Test1, b:B of .Test1.foo) returnType:kotlin.Unit overridden: public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:B index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> - VALUE_PARAMETER DELEGATED_MEMBER name:a index:0 type:A of .IBase - VALUE_PARAMETER DELEGATED_MEMBER name:b index:1 type:B of .IBase.foo + VALUE_PARAMETER DELEGATED_MEMBER name:a index:0 type:E of .Test1 + VALUE_PARAMETER DELEGATED_MEMBER name:b index:1 type:B of .Test1.foo BLOCK_BODY CALL 'public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.foo' type=.Test1.Test1> origin=null - a: GET_VAR 'a: A of .IBase declared in .Test1.foo' type=A of .IBase origin=null - b: GET_VAR 'b: B of .IBase.foo declared in .Test1.foo' type=B of .IBase.foo origin=null + a: GET_VAR 'a: E of .Test1 declared in .Test1.foo' type=E of .Test1 origin=null + b: GET_VAR 'b: B of .Test1.foo declared in .Test1.foo' type=B of .Test1.foo origin=null PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.collections.Map.IBase, C of .IBase.>? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>) returnType:kotlin.collections.Map.IBase, C of .IBase.>? correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:C index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .Test1' - CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.IBase, C of .IBase.>? origin=null + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .Test1' + CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.Test1, C of .Test1.>? origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:D of .IBase.? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>) returnType:D of .IBase.? correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] overridden: public abstract fun (): D of .IBase.? declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:D index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): D of .IBase.? declared in .Test1' - CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .IBase.? origin=null + RETURN type=kotlin.Nothing from='public open fun (): D of .IBase.? declared in .Test1' + CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .Test1.? origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test1.Test1>, :D of .IBase.?) returnType:kotlin.Unit + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, :D of .Test1.?) returnType:kotlin.Unit correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] overridden: public abstract fun (: D of .IBase.?): kotlin.Unit declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:D index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> - VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:D of .IBase.? + VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:D of .Test1.? BLOCK_BODY CALL 'public abstract fun (: D of .IBase.?): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null - : GET_VAR ': D of .IBase.? declared in .Test1.' type=D of .IBase.? origin=null + : GET_VAR ': D of .Test1.? declared in .Test1.' type=D of .Test1.? origin=null FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:local [final] FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: @@ -141,55 +145,59 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=kotlin.Unit origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null value: GET_VAR ': .IBase declared in .Test2.' type=.IBase origin=null - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test2, a:A of .IBase, b:B of .IBase.foo) returnType:kotlin.Unit + FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test2, a:kotlin.String, b:B of .Test2.foo) returnType:kotlin.Unit overridden: public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:B index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - VALUE_PARAMETER DELEGATED_MEMBER name:a index:0 type:A of .IBase - VALUE_PARAMETER DELEGATED_MEMBER name:b index:1 type:B of .IBase.foo + VALUE_PARAMETER DELEGATED_MEMBER name:a index:0 type:kotlin.String + VALUE_PARAMETER DELEGATED_MEMBER name:b index:1 type:B of .Test2.foo BLOCK_BODY CALL 'public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:local [final]' type=.IBase origin=null receiver: GET_VAR ': .Test2 declared in .Test2.foo' type=.Test2 origin=null - a: GET_VAR 'a: A of .IBase declared in .Test2.foo' type=A of .IBase origin=null - b: GET_VAR 'b: B of .IBase.foo declared in .Test2.foo' type=B of .IBase.foo origin=null + a: GET_VAR 'a: kotlin.String declared in .Test2.foo' type=kotlin.String origin=null + b: GET_VAR 'b: B of .Test2.foo declared in .Test2.foo' type=B of .Test2.foo origin=null PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.collections.Map.IBase, C of .IBase.>? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2) returnType:kotlin.collections.Map.IBase, C of .IBase.>? correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:C index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .Test2' - CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.IBase, C of .IBase.>? origin=null + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .Test2' + CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.Test2.>? origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:local [final]' type=.IBase origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2) returnType:D of .IBase.? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2) returnType:D of .IBase.? correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] overridden: public abstract fun (): D of .IBase.? declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:D index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): D of .IBase.? declared in .Test2' - CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .IBase.? origin=null + RETURN type=kotlin.Nothing from='public open fun (): D of .IBase.? declared in .Test2' + CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .Test2.? origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:local [final]' type=.IBase origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2, :D of .IBase.?) returnType:kotlin.Unit + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2, :D of .Test2.?) returnType:kotlin.Unit correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] overridden: public abstract fun (: D of .IBase.?): kotlin.Unit declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:D index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:D of .IBase.? + VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:D of .Test2.? BLOCK_BODY CALL 'public abstract fun (: D of .IBase.?): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:local [final]' type=.IBase origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - : GET_VAR ': D of .IBase.? declared in .Test2.' type=D of .IBase.? origin=null + : GET_VAR ': D of .Test2.? declared in .Test2.' type=D of .Test2.? origin=null FIELD DELEGATE name:$$delegate_0 type:.IBase visibility:local [final] 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/kt35550.fir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.txt index 8fb040c1089..d1c633ffb45 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.txt @@ -34,14 +34,15 @@ FILE fqName: fileName:/kt35550.kt receiver: GET_VAR ': .A declared in .A' type=.A origin=null value: GET_VAR 'i: .I declared in .A.' type=.I origin=null PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.A) returnType:T of .I. + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.A) returnType:T of .I. correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public open fun (): T of .I. declared in .I + TYPE_PARAMETER DELEGATED_MEMBER name:T index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.A BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): T of .I. declared in .A' - CALL 'public open fun (): T of .I. declared in .I' type=T of .I. origin=null + RETURN type=kotlin.Nothing from='public open fun (): T of .I. declared in .A' + CALL 'public open fun (): T of .I. declared in .I' type=T of .A. origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.I visibility:local [final]' type=.I origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt index 853e4d287c0..d2cc97ac35d 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt @@ -59,19 +59,20 @@ FILE fqName: fileName:/delegatedMembers.kt CALL 'public abstract fun (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:local [final]' type=.IBase.Test> origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.' type=.Test.Test> origin=null - FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:.Test.Test>, t:T of .IBase, x:X of .IBase.qux) returnType:kotlin.Unit + FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN ($this:.Test.Test>, t:TT of .Test, x:X of .Test.qux) returnType:kotlin.Unit overridden: public abstract fun qux (t: T of .IBase, x: X of .IBase.qux): kotlin.Unit declared in .IBase + TYPE_PARAMETER DELEGATED_MEMBER name:X index:0 variance: superTypes:[] $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test.Test> - VALUE_PARAMETER DELEGATED_MEMBER name:t index:0 type:T of .IBase - VALUE_PARAMETER DELEGATED_MEMBER name:x index:1 type:X of .IBase.qux + VALUE_PARAMETER DELEGATED_MEMBER name:t index:0 type:TT of .Test + VALUE_PARAMETER DELEGATED_MEMBER name:x index:1 type:X of .Test.qux BLOCK_BODY CALL 'public abstract fun qux (t: T of .IBase, x: X of .IBase.qux): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:local [final]' type=.IBase.Test> origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.qux' type=.Test.Test> origin=null - t: GET_VAR 't: T of .IBase declared in .Test.qux' type=T of .IBase origin=null - x: GET_VAR 'x: X of .IBase.qux declared in .Test.qux' type=X of .IBase.qux origin=null + t: GET_VAR 't: TT of .Test declared in .Test.qux' type=TT of .Test origin=null + x: GET_VAR 'x: X of .Test.qux declared in .Test.qux' type=X of .Test.qux origin=null FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:local [final] FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: