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 63de0b58b4e..3f1fa58a9c1 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 @@ -31,10 +31,7 @@ import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.resolve.firProvider import org.jetbrains.kotlin.fir.resolve.firSymbolProvider import org.jetbrains.kotlin.fir.resolve.isKFunctionInvoke -import org.jetbrains.kotlin.fir.symbols.Fir2IrConstructorSymbol -import org.jetbrains.kotlin.fir.symbols.Fir2IrPropertySymbol -import org.jetbrains.kotlin.fir.symbols.Fir2IrSimpleFunctionSymbol -import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol +import org.jetbrains.kotlin.fir.symbols.* import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI @@ -82,6 +79,7 @@ class Fir2IrDeclarationStorage( private val initializerCache = mutableMapOf() private val propertyCache = mutableMapOf() + private val delegatedReverseCache = mutableMapOf() private val fieldCache = mutableMapOf() @@ -371,10 +369,13 @@ class Fir2IrDeclarationStorage( } } - internal fun cacheIrSimpleFunction(function: FirSimpleFunction, irFunction: IrSimpleFunction) { + internal fun cacheDelegationFunction(function: FirSimpleFunction, irFunction: IrSimpleFunction) { functionCache[function] = irFunction + delegatedReverseCache[irFunction] = function } + fun originalDeclarationForDelegated(irDeclaration: IrDeclaration): FirDeclaration? = delegatedReverseCache[irDeclaration] + internal fun declareIrSimpleFunction( signature: IdSignature?, containerSource: DeserializedContainerSource?, @@ -745,8 +746,9 @@ class Fir2IrDeclarationStorage( fun getCachedIrProperty(property: FirProperty): IrProperty? = propertyCache[property] - internal fun cacheIrProperty(property: FirProperty, irProperty: IrProperty) { + internal fun cacheDelegatedProperty(property: FirProperty, irProperty: IrProperty) { propertyCache[property] = irProperty + delegatedReverseCache[irProperty] = property } fun getCachedIrField(field: FirField): IrField? = fieldCache[field] @@ -754,7 +756,7 @@ class Fir2IrDeclarationStorage( fun createIrFieldAndDelegatedMembers(field: FirField, owner: FirClass<*>, irClass: IrClass): IrField { val irField = createIrField(field, origin = IrDeclarationOrigin.DELEGATE) irField.setAndModifyParent(irClass) - delegatedMemberGenerator.generate(irField, owner, irClass) + delegatedMemberGenerator.generate(irField, field, owner, irClass) return irField } 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 fd256fbac7a..d0b7e24aefd 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 @@ -5,40 +5,21 @@ package org.jetbrains.kotlin.fir.backend.generators -import org.jetbrains.kotlin.backend.common.ir.isFinalClass -import org.jetbrains.kotlin.backend.common.ir.isOverridable import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.backend.* -import org.jetbrains.kotlin.fir.backend.declareThisReceiverParameter import org.jetbrains.kotlin.fir.declarations.* -import org.jetbrains.kotlin.fir.declarations.builder.buildProperty -import org.jetbrains.kotlin.fir.declarations.builder.buildSimpleFunction -import org.jetbrains.kotlin.fir.declarations.builder.buildValueParameterCopy -import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl -import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope -import org.jetbrains.kotlin.fir.symbols.CallableId -import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol -import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol +import org.jetbrains.kotlin.fir.scopes.* +import org.jetbrains.kotlin.fir.scopes.impl.delegatedWrapperData +import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag +import org.jetbrains.kotlin.fir.symbols.PossiblyFirFakeOverrideSymbol +import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.ir.declarations.* -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.IrBlockBody import org.jetbrains.kotlin.ir.expressions.impl.IrCallImpl import org.jetbrains.kotlin.ir.expressions.impl.IrGetFieldImpl import org.jetbrains.kotlin.ir.expressions.impl.IrGetValueImpl import org.jetbrains.kotlin.ir.expressions.impl.IrReturnImpl -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.impl.makeTypeProjection -import org.jetbrains.kotlin.ir.util.* -import org.jetbrains.kotlin.name.FqName -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.Variance -import org.jetbrains.kotlin.utils.DFS /** * A generator for delegated members from implementation by delegation. @@ -52,239 +33,119 @@ internal class DelegatedMemberGenerator( ) : Fir2IrComponents by components { // Generate delegated members for [subClass]. The synthetic field [irField] has the super interface type. - fun generate(irField: IrField, firSubClass: FirClass<*>, subClass: IrClass) { - val delegateClass = (irField.type as IrSimpleTypeImpl).classOrNull?.owner ?: return - val subClasses = mutableMapOf(delegateClass to mutableListOf(subClass)) - DFS.dfs( - listOf(delegateClass), { node -> node.superTypes.mapNotNull { it.classOrNull?.owner } }, - object : DFS.NodeHandler { - override fun beforeChildren(current: IrClass): Boolean { - for (superType in current.superTypes) { - superType.classOrNull?.owner?.let { subClasses.getOrPut(it) { mutableListOf() }.add(current) } - } - return true - } + fun generate(irField: IrField, firField: FirField, firSubClass: FirClass<*>, subClass: IrClass) { + val subClassLookupTag = firSubClass.symbol.toLookupTag() - override fun afterChildren(current: IrClass) = Unit - override fun result() = Unit - } - ) + val subClassScope = firSubClass.unsubstitutedScope(session, scopeSession) + subClassScope.processAllFunctions { functionSymbol -> + if (functionSymbol !is FirNamedFunctionSymbol) return@processAllFunctions - for ((superClass, mayOverride) in subClasses) { - val superClassId = superClass.classId ?: continue - if (superClassId == irBuiltIns.anyClass.owner.classId) continue - for (member in superClass.declarations) { - val delegatable = member.isDelegatable() && !DFS.ifAny(mayOverride, { subClasses[it] ?: emptyList() }) { - // Delegate to the most specific version of each member. - it.declarations.any { !it.isFakeOverride && it.overrides(member) } - } - if (!delegatable) continue - val scope = firSubClass.unsubstitutedScope(session, scopeSession) - if (member is IrSimpleFunction) { - val firSuperFunction = declarationStorage.findOverriddenFirFunction(member, superClassId) ?: return - var firSubFunction: FirSimpleFunction? = null - scope.processFunctionsByName(member.name) { - if (it.callableId.classId == firSubClass.classId) { - var overriddenFunctionSymbol = it.overriddenSymbol - while (overriddenFunctionSymbol != null) { - if (overriddenFunctionSymbol.fir == firSuperFunction) { - firSubFunction = it.fir as FirSimpleFunction - break - } - overriddenFunctionSymbol = overriddenFunctionSymbol.overriddenSymbol - } - } - } - val irSubFunction = generateDelegatedFunction(subClass, irField, member, firSuperFunction) - firSubFunction?.let { declarationStorage.cacheIrSimpleFunction(it, irSubFunction) } - subClass.addMember(irSubFunction) - } else if (member is IrProperty) { - val firSuperProperty = declarationStorage.findOverriddenFirProperty(member, superClassId) ?: return - var firSubProperty: FirProperty? = null - scope.processPropertiesByName(member.name) { - if (it.callableId.classId == firSubClass.classId) { - var overriddenPropertySymbol = it.overriddenSymbol - while (overriddenPropertySymbol != null) { - if (overriddenPropertySymbol.fir == firSuperProperty) { - firSubProperty = it.fir as FirProperty - break - } - overriddenPropertySymbol = overriddenPropertySymbol.overriddenSymbol - } - } - } - val irSubProperty = generateDelegatedProperty(subClass, irField, member, firSuperProperty) - firSubProperty?.let { declarationStorage.cacheIrProperty(it, irSubProperty) } - } - } + val unwrapped = + functionSymbol + .unwrapDelegateTarget(subClassLookupTag, subClassScope::getDirectOverriddenFunctions, firField, firSubClass) + ?: return@processAllFunctions + + val member = + declarationStorage.getIrFunctionSymbol(unwrapped.symbol).owner as? IrSimpleFunction + ?: return@processAllFunctions + + if (isJavaDefault(unwrapped)) return@processAllFunctions + + val irSubFunction = generateDelegatedFunction( + subClass, firSubClass, irField, member, functionSymbol.fir + ) + + declarationStorage.cacheDelegationFunction(functionSymbol.fir, irSubFunction) + subClass.addMember(irSubFunction) + } + + subClassScope.processAllProperties { propertySymbol -> + if (propertySymbol !is FirPropertySymbol) return@processAllProperties + + val unwrapped = + propertySymbol + .unwrapDelegateTarget(subClassLookupTag, subClassScope::getDirectOverriddenProperties, firField, firSubClass) + ?: return@processAllProperties + + val member = declarationStorage.getIrPropertySymbol(unwrapped.symbol).owner as? IrProperty + ?: return@processAllProperties + + val irSubFunction = + generateDelegatedProperty(subClass, firSubClass, irField, member, propertySymbol.fir) + + declarationStorage.cacheDelegatedProperty(propertySymbol.fir, irSubFunction) + subClass.addMember(irSubFunction) } } - private fun IrDeclaration.overrides(other: IrDeclaration) = when { - // Imported declarations have overridden symbols, so check that first. - this is IrProperty && other is IrProperty -> - getter?.let { getter -> other.getter?.symbol in getter.overriddenSymbols } - ?: setter?.let { setter -> other.setter?.symbol in setter.overriddenSymbols } - ?: false - this is IrSimpleFunction && other is IrSimpleFunction -> - other.symbol in overriddenSymbols - else -> - false - } || isOverriding(irBuiltIns, this, other) // TODO check if this behaves correctly with generic arguments + private inline fun > S.unwrapDelegateTarget( + subClassLookupTag: ConeClassLikeLookupTag, + noinline directOverridden: S.() -> List, + firField: FirField, + firSubClass: FirClass<*>, + ): D? where S : FirCallableSymbol, S : PossiblyFirFakeOverrideSymbol { + val unwrappedIntersectionSymbol = + this.unwrapIntersectionOverride(directOverridden) ?: return null - private fun IrDeclaration.isDelegatable(): Boolean { - return isOverridable() - && !isFakeOverride - && !(this is IrSimpleFunction && hasDefaultImplementation()) - } + val callable = unwrappedIntersectionSymbol.fir as? D ?: return null - private fun IrDeclaration.isOverridable(): Boolean { - return when (this) { - is IrSimpleFunction -> this.isOverridable - is IrProperty -> visibility != org.jetbrains.kotlin.descriptors.DescriptorVisibilities.PRIVATE && modality != Modality.FINAL && (parent as? IrClass)?.isFinalClass != true - else -> false + val delegatedWrapperData = callable.delegatedWrapperData ?: return null + if (delegatedWrapperData.containingClass != subClassLookupTag) return null + if (delegatedWrapperData.delegateField != firField) return null + + val wrapped = delegatedWrapperData.wrapped as? D ?: return null + val wrappedSymbol = wrapped.symbol as? S ?: return null + + return when { + wrappedSymbol.isFakeOverride && wrappedSymbol.callableId.classId == firSubClass.classId -> + wrapped.symbol.overriddenSymbol!!.fir + else -> wrapped } } - private fun IrSimpleFunction.hasDefaultImplementation(): Boolean { - var realFunction: IrSimpleFunction? = this - while (realFunction != null && realFunction.isFakeOverride) { - realFunction = realFunction.overriddenSymbols.firstOrNull()?.owner - } - return realFunction != null - && (realFunction.modality != Modality.ABSTRACT && realFunction.origin == IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB - || realFunction.annotations.hasAnnotation(FqName("kotlin.jvm.JvmDefault"))) + private fun isJavaDefault(function: FirSimpleFunction): Boolean { + if (function.symbol.isIntersectionOverride) return isJavaDefault(function.symbol.overriddenSymbol!!.fir) + return function.origin == FirDeclarationOrigin.Enhancement && function.modality == Modality.OPEN + } + + private fun > S.unwrapIntersectionOverride(directOverridden: S.() -> List): S? { + if (this !is PossiblyFirFakeOverrideSymbol<*, *>) return this + if (this.isIntersectionOverride) return directOverridden().firstOrNull { it.fir.delegatedWrapperData != null } + return this } private fun generateDelegatedFunction( subClass: IrClass, + firSubClass: FirClass<*>, irField: IrField, superFunction: IrSimpleFunction, - firSuperFunction: FirFunction<*> + delegateOverride: FirSimpleFunction ): IrSimpleFunction { + val delegateFunction = + declarationStorage.createIrFunction( + delegateOverride, subClass, origin = IrDeclarationOrigin.DELEGATED_MEMBER, + containingClass = firSubClass.symbol.toLookupTag() + ) + delegateFunction.overriddenSymbols = + delegateOverride.generateOverriddenFunctionSymbols(firSubClass, session, scopeSession, declarationStorage) + + val body = createDelegateBody(irField, delegateFunction, superFunction) + delegateFunction.body = body + return delegateFunction + } + + private fun createDelegateBody( + irField: IrField, + delegateFunction: IrSimpleFunction, + superFunction: IrSimpleFunction + ): IrBlockBody { val startOffset = irField.startOffset val endOffset = irField.endOffset - 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 -> - irFactory.createFunction( - startOffset, - endOffset, - origin, - symbol, - superFunction.name, - superFunction.visibility, - modality, - superFunction.returnType, - superFunction.isInline, - superFunction.isExternal, - superFunction.isTailrec, - superFunction.isSuspend, - superFunction.isOperator, - superFunction.isInfix, - superFunction.isExpect - ).apply { - descriptor.bind(this) - declarationStorage.enterScope(this) - this.parent = subClass - overriddenSymbols = listOf(superFunction.symbol) - dispatchReceiverParameter = declareThisReceiverParameter(symbolTable, subClass.defaultType, origin) - if (addTypeSubstitution) { - val substParameters = mutableListOf() - val substArguments = mutableListOf() - initializeTypeSubstitution(substParameters, substArguments, irField.type) - typeParameters = superFunction.typeParameters.map { typeParameter -> - val parameterDescriptor = WrappedTypeParameterDescriptor() - symbolTable.declareScopedTypeParameter( - startOffset, endOffset, origin, parameterDescriptor - ) { symbol -> - irFactory.createTypeParameter( - 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()) - ) - ) - it.superTypes += typeParameter.superTypes - } - } - } - irTypeSubstitutor = IrTypeSubstitutor(substParameters, substArguments, irBuiltIns) - } - superFunction.extensionReceiverParameter?.let { - val substitutedType = if (addTypeSubstitution) irTypeSubstitutor.substitute(it.type) else it.type - extensionReceiverParameter = declareThisReceiverParameter(symbolTable, substitutedType, origin) - } - valueParameters = superFunction.valueParameters.map { valueParameter -> - val parameterDescriptor = WrappedValueParameterDescriptor() - val substedType = if (addTypeSubstitution) irTypeSubstitutor.substitute(valueParameter.type) else valueParameter.type - symbolTable.declareValueParameter( - startOffset, endOffset, origin, parameterDescriptor, substedType - ) { symbol -> - irFactory.createValueParameter( - startOffset, endOffset, origin, symbol, - valueParameter.name, valueParameter.index, substedType, - null, valueParameter.isCrossinline, valueParameter.isNoinline - ).also { - parameterDescriptor.bind(it) - it.parent = this - } - } - } - - val visibility = when (firSuperFunction) { - is FirSimpleFunction -> firSuperFunction.status.visibility - is FirPropertyAccessor -> firSuperFunction.status.visibility - else -> Visibilities.Public - } - metadata = FirMetadataSource.Function( - buildSimpleFunction { - this.origin = FirDeclarationOrigin.Synthetic - this.name = superFunction.name - this.symbol = FirNamedFunctionSymbol(getCallableId(subClass, superFunction.name)) - this.status = FirDeclarationStatusImpl(visibility, modality) - this.session = components.session - this.returnTypeRef = firSuperFunction.returnTypeRef - firSuperFunction.valueParameters.map { superParameter -> - this.valueParameters.add( - buildValueParameterCopy(superParameter) { - this.origin = FirDeclarationOrigin.Synthetic - this.session = components.session - this.symbol = FirVariableSymbol(superParameter.name) - } - ) - } - } - ) - - declarationStorage.leaveScope(this) - } - } - val body = irFactory.createBlockBody(startOffset, endOffset) val irCall = IrCallImpl( startOffset, endOffset, - if (addTypeSubstitution) irTypeSubstitutor.substitute(superFunction.returnType) else superFunction.returnType, + delegateFunction.returnType, superFunction.symbol, superFunction.typeParameters.size, superFunction.valueParameters.size @@ -314,79 +175,34 @@ internal class DelegatedMemberGenerator( val irReturn = IrReturnImpl(startOffset, endOffset, irBuiltIns.nothingType, delegateFunction.symbol, irCall) body.statements.add(irReturn) } - delegateFunction.body = body - 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) - } - } + return body } private fun generateDelegatedProperty( subClass: IrClass, + firSubClass: FirClass<*>, irField: IrField, superProperty: IrProperty, - firSuperProperty: FirProperty + firDelegateProperty: FirProperty ): IrProperty { - val startOffset = irField.startOffset - val endOffset = irField.endOffset - val descriptor = WrappedPropertyDescriptor() - val modality = if (superProperty.modality == Modality.ABSTRACT) Modality.OPEN else superProperty.modality - return symbolTable.declareProperty( - startOffset, endOffset, - IrDeclarationOrigin.DELEGATED_MEMBER, descriptor, superProperty.isDelegated - ) { symbol -> - irFactory.createProperty( - startOffset, endOffset, IrDeclarationOrigin.DELEGATED_MEMBER, symbol, - superProperty.name, superProperty.visibility, - modality, - isVar = superProperty.isVar, - isConst = superProperty.isConst, - isLateinit = superProperty.isLateinit, - isDelegated = superProperty.isDelegated, - isExternal = false, - isExpect = superProperty.isExpect, - isFakeOverride = false - ).apply { - descriptor.bind(this) - this.parent = subClass - getter = generateDelegatedFunction(subClass, irField, superProperty.getter!!, firSuperProperty.getter!!).apply { - this.correspondingPropertySymbol = symbol - } - if (superProperty.isVar) { - setter = generateDelegatedFunction(subClass, irField, superProperty.setter!!, firSuperProperty.setter!!).apply { - this.correspondingPropertySymbol = symbol - } - } - this.metadata = FirMetadataSource.Property( - buildProperty { - this.name = superProperty.name - this.origin = FirDeclarationOrigin.Synthetic - this.session = components.session - this.status = FirDeclarationStatusImpl(firSuperProperty.status.visibility, modality) - this.isLocal = firSuperProperty.isLocal - this.returnTypeRef = firSuperProperty.returnTypeRef - this.symbol = FirPropertySymbol(getCallableId(subClass, superProperty.name)) - this.isVar = firSuperProperty.isVar - } + val delegateProperty = + declarationStorage.createIrProperty( + firDelegateProperty, subClass, origin = IrDeclarationOrigin.DELEGATED_MEMBER, + containingClass = firSubClass.symbol.toLookupTag() + ) + + delegateProperty.getter!!.body = createDelegateBody(irField, delegateProperty.getter!!, superProperty.getter!!) + delegateProperty.getter!!.overriddenSymbols = + firDelegateProperty.generateOverriddenAccessorSymbols(firSubClass, isGetter = true, session, scopeSession, declarationStorage) + if (delegateProperty.isVar) { + delegateProperty.setter!!.body = createDelegateBody(irField, delegateProperty.setter!!, superProperty.setter!!) + delegateProperty.setter!!.overriddenSymbols = + firDelegateProperty.generateOverriddenAccessorSymbols( + firSubClass, isGetter = false, session, scopeSession, declarationStorage ) - subClass.addMember(this) - } } + + return delegateProperty } - private fun getCallableId(irClass: IrClass, name: Name): CallableId { - val classId = irClass.classId - return if (classId != null) CallableId(classId, name) else CallableId(name) - } } diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirContainingNamesAwareScope.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirContainingNamesAwareScope.kt index 812db2cea99..d0fcc4c6325 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirContainingNamesAwareScope.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirContainingNamesAwareScope.kt @@ -5,6 +5,8 @@ package org.jetbrains.kotlin.fir.scopes +import org.jetbrains.kotlin.fir.symbols.impl.FirFunctionSymbol +import org.jetbrains.kotlin.fir.symbols.impl.FirVariableSymbol import org.jetbrains.kotlin.name.Name interface FirContainingNamesAwareScope { @@ -18,3 +20,27 @@ fun FirScope.getContainingCallableNamesIfPresent(): Set = fun FirScope.getContainingClassifierNamesIfPresent(): Set = if (this is FirContainingNamesAwareScope) getClassifierNames() else emptySet() + +fun S.processAllFunctions(processor: (FirFunctionSymbol<*>) -> Unit) where S : FirScope, S : FirContainingNamesAwareScope { + for (name in getCallableNames()) { + processFunctionsByName(name, processor) + } +} + +fun S.processAllProperties(processor: (FirVariableSymbol<*>) -> Unit) where S : FirScope, S : FirContainingNamesAwareScope { + for (name in getCallableNames()) { + processPropertiesByName(name, processor) + } +} + +fun S.collectAllFunctions(): Collection> where S : FirScope, S : FirContainingNamesAwareScope { + return mutableListOf>().apply { + processAllFunctions(this::add) + } +} + +fun S.collectAllProperties(): Collection> where S : FirScope, S : FirContainingNamesAwareScope { + return mutableListOf>().apply { + processAllProperties(this::add) + } +} diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt index c06b8aea954..865f37c1eeb 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt @@ -52,10 +52,10 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt 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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> - 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 + TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test1.Test1> + VALUE_PARAMETER name:a index:0 type:E of .Test1 + VALUE_PARAMETER 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 : @@ -63,65 +63,81 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test1.Test1> declared in .Test1.foo' type=.Test1.Test1> 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 + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1.Test1>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1.Test1> + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean 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.equals' type=.Test1.Test1> origin=null + other: GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1.Test1> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int 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.hashCode' type=.Test1.Test1> origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1.Test1>) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1.Test1> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String 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.toString' type=.Test1.Test1> origin=null PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, $receiver:C of .Test1.) returnType:kotlin.collections.Map.IBase, C of .IBase.>? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, $receiver:C of .Test1.) returnType:kotlin.collections.Map.Test1, C of .Test1.>? 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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:C of .Test1. + TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test1.Test1> + $receiver: VALUE_PARAMETER name: type:C of .Test1. BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .Test1' + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.Test1, C of .Test1.>? 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 $receiver: GET_VAR ': C of .Test1. declared in .Test1.' type=C of .Test1. origin=null PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, $receiver:kotlin.collections.List.Test1.>) returnType:D of .IBase.? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, $receiver:kotlin.collections.List.Test1.>) returnType:D of .Test1.? 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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.collections.List.Test1.> + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test1.Test1> + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.Test1.> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): D of .IBase.? declared in .Test1' + RETURN type=kotlin.Nothing from='public open fun (): D of .Test1.? 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 $receiver: GET_VAR ': kotlin.collections.List.Test1.> declared in .Test1.' type=kotlin.collections.List.Test1.> origin=null - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, $receiver:kotlin.collections.List.Test1.>, :D of .Test1.?) returnType:kotlin.Unit + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, $receiver:kotlin.collections.List.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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1.Test1> - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.collections.List.Test1.> - VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:D of .Test1.? + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test1.Test1> + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.Test1.> + VALUE_PARAMETER 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 - $receiver: GET_VAR ': kotlin.collections.List.Test1.> declared in .Test1.' type=kotlin.collections.List.Test1.> origin=null + $receiver: GET_VAR ': kotlin.collections.List.Test1.> declared in .Test1.' type=kotlin.collections.List.Test1.> 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: - 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 CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 CONSTRUCTOR visibility:public <> (j:.IBase) returnType:.Test2 [primary] @@ -154,10 +170,10 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt 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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - VALUE_PARAMETER DELEGATED_MEMBER name:a index:0 type:kotlin.String - VALUE_PARAMETER DELEGATED_MEMBER name:b index:1 type:B of .Test2.foo + TYPE_PARAMETER name:B index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:a index:0 type:kotlin.String + VALUE_PARAMETER 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 : @@ -165,62 +181,78 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test2 declared in .Test2.foo' type=.Test2 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 + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean 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.equals' type=.Test2 origin=null + other: GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int 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.hashCode' type=.Test2 origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String 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.toString' type=.Test2 origin=null PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2, $receiver:C of .Test2.) returnType:kotlin.collections.Map.IBase, C of .IBase.>? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2, $receiver:C of .Test2.) returnType:kotlin.collections.Map.Test2.>? 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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:C of .Test2. + TYPE_PARAMETER name:C index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test2 + $receiver: VALUE_PARAMETER name: type:C of .Test2. BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .Test2' + RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.Test2.>? 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 $receiver: GET_VAR ': C of .Test2. declared in .Test2.' type=C of .Test2. origin=null PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2, $receiver:kotlin.collections.List.Test2.>) returnType:D of .IBase.? + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2, $receiver:kotlin.collections.List.Test2.>) returnType:D of .Test2.? 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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.collections.List.Test2.> + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test2 + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.Test2.> BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): D of .IBase.? declared in .Test2' + RETURN type=kotlin.Nothing from='public open fun (): D of .Test2.? 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 $receiver: GET_VAR ': kotlin.collections.List.Test2.> declared in .Test2.' type=kotlin.collections.List.Test2.> origin=null - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2, $receiver:kotlin.collections.List.Test2.>, :D of .Test2.?) returnType:kotlin.Unit + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test2, $receiver:kotlin.collections.List.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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.collections.List.Test2.> - VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:D of .Test2.? + TYPE_PARAMETER name:D index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test2 + $receiver: VALUE_PARAMETER name: type:kotlin.collections.List.Test2.> + VALUE_PARAMETER 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 - $receiver: GET_VAR ': kotlin.collections.List.Test2.> declared in .Test2.' type=kotlin.collections.List.Test2.> origin=null + $receiver: GET_VAR ': kotlin.collections.List.Test2.> declared in .Test2.' type=kotlin.collections.List.Test2.> 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: - 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/classes/delegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt index 115b7bd8904..1f7658a66b0 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt @@ -206,9 +206,9 @@ FILE fqName: fileName:/delegatedImplementation.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test1, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit overridden: public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1 - VALUE_PARAMETER DELEGATED_MEMBER name:x index:0 type:kotlin.Int - VALUE_PARAMETER DELEGATED_MEMBER name:s index:1 type:kotlin.String + $this: VALUE_PARAMETER name: type:.Test1 + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String BLOCK_BODY CALL 'public abstract fun foo (x: kotlin.Int, s: kotlin.String): 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 @@ -218,7 +218,7 @@ FILE fqName: fileName:/delegatedImplementation.kt FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int overridden: public abstract fun bar (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1 + $this: VALUE_PARAMETER name: type:.Test1 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .Test1' CALL 'public abstract fun bar (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null @@ -227,27 +227,43 @@ FILE fqName: fileName:/delegatedImplementation.kt FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:.Test1, $receiver:kotlin.String) returnType:kotlin.Unit overridden: public abstract fun qux (): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test1 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.String + $this: VALUE_PARAMETER name: type:.Test1 + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY CALL 'public abstract fun qux (): 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 ': .Test1 declared in .Test1.qux' type=.Test1 origin=null $receiver: GET_VAR ': kotlin.String declared in .Test1.qux' type=kotlin.String 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] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test1' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase visibility:local [final]' type=.IBase origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.equals' type=.Test1 origin=null + other: GET_VAR 'other: kotlin.Any? declared in .Test1.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test1' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase visibility:local [final]' type=.IBase origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.hashCode' type=.Test1 origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test1) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.Test1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test1' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase visibility:local [final]' type=.IBase origin=null + receiver: GET_VAR ': .Test1 declared in .Test1.toString' type=.Test1 origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IBase visibility:local [final] CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase; .IOther] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Test2 CONSTRUCTOR visibility:public <> () returnType:.Test2 [primary] @@ -265,9 +281,9 @@ FILE fqName: fileName:/delegatedImplementation.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test2, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit overridden: public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - VALUE_PARAMETER DELEGATED_MEMBER name:x index:0 type:kotlin.Int - VALUE_PARAMETER DELEGATED_MEMBER name:s index:1 type:kotlin.String + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:x index:0 type:kotlin.Int + VALUE_PARAMETER name:s index:1 type:kotlin.String BLOCK_BODY CALL 'public abstract fun foo (x: kotlin.Int, s: kotlin.String): 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 @@ -277,7 +293,7 @@ FILE fqName: fileName:/delegatedImplementation.kt FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int overridden: public abstract fun bar (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 + $this: VALUE_PARAMETER name: type:.Test2 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .Test2' CALL 'public abstract fun bar (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null @@ -286,20 +302,49 @@ FILE fqName: fileName:/delegatedImplementation.kt FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:.Test2, $receiver:kotlin.String) returnType:kotlin.Unit overridden: public abstract fun qux (): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.String + $this: VALUE_PARAMETER name: type:.Test2 + $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY CALL 'public abstract fun qux (): 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.qux' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.String declared in .Test2.qux' type=kotlin.String origin=null + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test2, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test2' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean 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.equals' type=.Test2 origin=null + other: GET_VAR 'other: kotlin.Any? declared in .Test2.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test2' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int 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.hashCode' type=.Test2 origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test2' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String 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.toString' type=.Test2 origin=null FIELD DELEGATE name:<$$delegate_0> type:.IBase visibility:local [final] PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val] FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2) returnType:kotlin.String correspondingProperty: PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val] overridden: public abstract fun (): kotlin.String declared in .IOther - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 + $this: VALUE_PARAMETER name: type:.Test2 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Test2' CALL 'public abstract fun (): kotlin.String declared in .IOther' type=kotlin.String origin=null @@ -310,7 +355,7 @@ FILE fqName: fileName:/delegatedImplementation.kt correspondingProperty: PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var] overridden: public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 + $this: VALUE_PARAMETER name: type:.Test2 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null @@ -320,8 +365,8 @@ FILE fqName: fileName:/delegatedImplementation.kt correspondingProperty: PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var] overridden: public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:kotlin.Int + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null @@ -332,8 +377,8 @@ FILE fqName: fileName:/delegatedImplementation.kt correspondingProperty: PROPERTY DELEGATED_MEMBER name:z1 visibility:public modality:OPEN [val] overridden: public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.Byte + $this: VALUE_PARAMETER name: type:.Test2 + $receiver: VALUE_PARAMETER name: type:kotlin.Byte BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null @@ -345,8 +390,8 @@ FILE fqName: fileName:/delegatedImplementation.kt correspondingProperty: PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var] overridden: public abstract fun (): kotlin.Int declared in .IOther - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.Byte + $this: VALUE_PARAMETER name: type:.Test2 + $receiver: VALUE_PARAMETER name: type:kotlin.Byte BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null @@ -357,9 +402,9 @@ FILE fqName: fileName:/delegatedImplementation.kt correspondingProperty: PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var] overridden: public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test2 - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:kotlin.Byte - VALUE_PARAMETER DELEGATED_MEMBER name: index:0 type:kotlin.Int + $this: VALUE_PARAMETER name: type:.Test2 + $receiver: VALUE_PARAMETER name: type:kotlin.Byte + VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null @@ -367,16 +412,3 @@ FILE fqName: fileName:/delegatedImplementation.kt $receiver: GET_VAR ': kotlin.Byte declared in .Test2.' type=kotlin.Byte origin=null : GET_VAR ': kotlin.Int declared in .Test2.' type=kotlin.Int origin=null FIELD DELEGATE name:<$$delegate_1> type:.IOther 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: - 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/classes/delegatedImplementationOfJavaInterface.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.txt index a9dfe2f625e..dd5d8c80a02 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.txt @@ -20,44 +20,90 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt RETURN type=kotlin.Nothing from='private final fun (): .J declared in .Test' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null - FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final] - FUN FAKE_OVERRIDE name:takeNotNull visibility:public modality:OPEN <> ($this:.J, x:kotlin.String) returnType:kotlin.Unit [fake_override] + FUN DELEGATED_MEMBER name:takeNotNull visibility:public modality:OPEN <> ($this:.Test, x:kotlin.String) returnType:kotlin.Unit overridden: public abstract fun takeNotNull (x: kotlin.String): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.J + $this: VALUE_PARAMETER name: type:.Test VALUE_PARAMETER name:x index:0 type:kotlin.String - FUN FAKE_OVERRIDE name:takeNullable visibility:public modality:OPEN <> ($this:.J, x:kotlin.String?) returnType:kotlin.Unit [fake_override] + BLOCK_BODY + CALL 'public abstract fun takeNotNull (x: kotlin.String): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.takeNotNull' type=.Test origin=null + x: GET_VAR 'x: kotlin.String declared in .Test.takeNotNull' type=kotlin.String origin=null + FUN DELEGATED_MEMBER name:takeNullable visibility:public modality:OPEN <> ($this:.Test, x:kotlin.String?) returnType:kotlin.Unit overridden: public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.J + $this: VALUE_PARAMETER name: type:.Test VALUE_PARAMETER name:x index:0 type:kotlin.String? - FUN FAKE_OVERRIDE name:takeFlexible visibility:public modality:OPEN <> ($this:.J, x:kotlin.String?) returnType:kotlin.Unit [fake_override] + BLOCK_BODY + CALL 'public abstract fun takeNullable (x: kotlin.String?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.takeNullable' type=.Test origin=null + x: GET_VAR 'x: kotlin.String? declared in .Test.takeNullable' type=kotlin.String? origin=null + FUN DELEGATED_MEMBER name:takeFlexible visibility:public modality:OPEN <> ($this:.Test, x:kotlin.String?) returnType:kotlin.Unit overridden: public abstract fun takeFlexible (x: kotlin.String?): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.J + $this: VALUE_PARAMETER name: type:.Test VALUE_PARAMETER name:x index:0 type:kotlin.String? - FUN FAKE_OVERRIDE name:returnNotNull visibility:public modality:OPEN <> ($this:.J) returnType:kotlin.String [fake_override] + BLOCK_BODY + CALL 'public abstract fun takeFlexible (x: kotlin.String?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.takeFlexible' type=.Test origin=null + x: GET_VAR 'x: kotlin.String? declared in .Test.takeFlexible' type=kotlin.String? origin=null + FUN DELEGATED_MEMBER name:returnNotNull visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.String overridden: public abstract fun returnNotNull (): kotlin.String declared in .J - $this: VALUE_PARAMETER name: type:.J - FUN FAKE_OVERRIDE name:returnNullable visibility:public modality:OPEN <> ($this:.J) returnType:kotlin.String? [fake_override] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun returnNotNull (): kotlin.String declared in .Test' + CALL 'public abstract fun returnNotNull (): kotlin.String declared in .J' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.returnNotNull' type=.Test origin=null + FUN DELEGATED_MEMBER name:returnNullable visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.String? overridden: public abstract fun returnNullable (): kotlin.String? declared in .J - $this: VALUE_PARAMETER name: type:.J - FUN FAKE_OVERRIDE name:returnsFlexible visibility:public modality:OPEN <> ($this:.J) returnType:kotlin.String? [fake_override] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun returnNullable (): kotlin.String? declared in .Test' + CALL 'public abstract fun returnNullable (): kotlin.String? declared in .J' type=kotlin.String? origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.returnNullable' type=.Test origin=null + FUN DELEGATED_MEMBER name:returnsFlexible visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.String? overridden: public abstract fun returnsFlexible (): kotlin.String? declared in .J - $this: VALUE_PARAMETER name: type:.J - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun returnsFlexible (): kotlin.String? declared in .Test' + CALL 'public abstract fun returnsFlexible (): kotlin.String? declared in .J' type=kotlin.String? origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.returnsFlexible' type=.Test origin=null + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.Test 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.equals' type=.Test origin=null + other: GET_VAR 'other: kotlin.Any? declared in .Test.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.hashCode' type=.Test origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.toString' type=.Test origin=null + FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final] diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt index 5f7530a15e4..3265f6c05ef 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt @@ -64,22 +64,38 @@ FILE fqName: fileName:/delegatedImplementationWithExplicitOverride.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Unit overridden: public abstract fun foo (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.C + $this: VALUE_PARAMETER name: type:.C BLOCK_BODY CALL 'public abstract fun foo (): kotlin.Unit declared in .IFooBar' type=kotlin.Unit origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFooBar visibility:local [final]' type=.IFooBar origin=null receiver: GET_VAR ': .C declared in .C.foo' type=.C origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFooBar visibility:local [final] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.C, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.C 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .C' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFooBar visibility:local [final]' type=.IFooBar origin=null + receiver: GET_VAR ': .C declared in .C.equals' type=.C origin=null + other: GET_VAR 'other: kotlin.Any? declared in .C.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .C' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFooBar visibility:local [final]' type=.IFooBar origin=null + receiver: GET_VAR ': .C declared in .C.hashCode' type=.C origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.C + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .C' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFooBar visibility:local [final]' type=.IFooBar origin=null + receiver: GET_VAR ': .C declared in .C.toString' type=.C origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IFooBar visibility:local [final] diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt index d33b0a142ee..c7858df0dce 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt @@ -72,8 +72,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () [primary] declared in .JUnrelatedFoo' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:K3 modality:FINAL visibility:public superTypes:[.JUnrelatedFoo; .IFoo]' - FUN FAKE_OVERRIDE name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String [fake_override] + FUN FAKE_OVERRIDE name:foo visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] overridden: + public open fun foo (): kotlin.String? declared in .JUnrelatedFoo public abstract fun foo (): kotlin.String declared in .IFoo $this: VALUE_PARAMETER name: type:.IFoo FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -129,26 +130,42 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestJFoo) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.TestJFoo + $this: VALUE_PARAMETER name: type:.TestJFoo BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestJFoo' CALL 'public abstract fun foo (): kotlin.String declared in .IFoo' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null receiver: GET_VAR ': .TestJFoo declared in .TestJFoo.foo' type=.TestJFoo origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestJFoo, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestJFoo 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestJFoo' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestJFoo declared in .TestJFoo.equals' type=.TestJFoo origin=null + other: GET_VAR 'other: kotlin.Any? declared in .TestJFoo.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestJFoo) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.TestJFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestJFoo' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestJFoo declared in .TestJFoo.hashCode' type=.TestJFoo origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestJFoo) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestJFoo + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestJFoo' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestJFoo declared in .TestJFoo.toString' type=.TestJFoo origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK1 CONSTRUCTOR visibility:public <> () returnType:.TestK1 [primary] @@ -161,26 +178,42 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK1) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.TestK1 + $this: VALUE_PARAMETER name: type:.TestK1 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK1' CALL 'public abstract fun foo (): kotlin.String declared in .IFoo' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null receiver: GET_VAR ': .TestK1 declared in .TestK1.foo' type=.TestK1 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK1 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestK1' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK1 declared in .TestK1.equals' type=.TestK1 origin=null + other: GET_VAR 'other: kotlin.Any? declared in .TestK1.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestK1) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.TestK1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestK1' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK1 declared in .TestK1.hashCode' type=.TestK1 origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestK1) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK1 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestK1' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK1 declared in .TestK1.toString' type=.TestK1 origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK2 CONSTRUCTOR visibility:public <> () returnType:.TestK2 [primary] @@ -193,26 +226,42 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK2) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.TestK2 + $this: VALUE_PARAMETER name: type:.TestK2 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK2' CALL 'public abstract fun foo (): kotlin.String declared in .IFoo' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null receiver: GET_VAR ': .TestK2 declared in .TestK2.foo' type=.TestK2 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK2, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK2 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestK2' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK2 declared in .TestK2.equals' type=.TestK2 origin=null + other: GET_VAR 'other: kotlin.Any? declared in .TestK2.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestK2) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.TestK2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestK2' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK2 declared in .TestK2.hashCode' type=.TestK2 origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestK2) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestK2' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK2 declared in .TestK2.toString' type=.TestK2 origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK3 CONSTRUCTOR visibility:public <> () returnType:.TestK3 [primary] @@ -225,26 +274,42 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK3) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.TestK3 + $this: VALUE_PARAMETER name: type:.TestK3 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK3' CALL 'public abstract fun foo (): kotlin.String declared in .IFoo' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null receiver: GET_VAR ': .TestK3 declared in .TestK3.foo' type=.TestK3 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK3, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK3 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestK3' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK3 declared in .TestK3.equals' type=.TestK3 origin=null + other: GET_VAR 'other: kotlin.Any? declared in .TestK3.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestK3) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.TestK3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestK3' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK3 declared in .TestK3.hashCode' type=.TestK3 origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestK3) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK3 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestK3' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK3 declared in .TestK3.toString' type=.TestK3 origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK4 CONSTRUCTOR visibility:public <> () returnType:.TestK4 [primary] @@ -257,23 +322,39 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK4) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.TestK4 + $this: VALUE_PARAMETER name: type:.TestK4 BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK4' CALL 'public abstract fun foo (): kotlin.String declared in .IFoo' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null receiver: GET_VAR ': .TestK4 declared in .TestK4.foo' type=.TestK4 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK4, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK4 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .TestK4' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK4 declared in .TestK4.equals' type=.TestK4 origin=null + other: GET_VAR 'other: kotlin.Any? declared in .TestK4.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.TestK4) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.TestK4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .TestK4' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK4 declared in .TestK4.hashCode' type=.TestK4 origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.TestK4) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.TestK4 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .TestK4' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + receiver: GET_VAR ': .TestK4 declared in .TestK4.toString' type=.TestK4 origin=null + FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.txt index 2a5e7545ff5..c291ac2f8ec 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.txt @@ -33,32 +33,48 @@ FILE fqName: fileName:/kt35550.kt SET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.I visibility:local [final]' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .A declared in .A' type=.A origin=null value: GET_VAR 'i: .I declared in .A.' type=.I origin=null + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.A, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + overridden: + public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + VALUE_PARAMETER name:other index:0 type:kotlin.Any? + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .A' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean 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.equals' type=.A origin=null + other: GET_VAR 'other: kotlin.Any? declared in .A.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.Int + overridden: + public open fun hashCode (): kotlin.Int declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .A' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int 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.hashCode' type=.A origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.A) returnType:kotlin.String + overridden: + public open fun toString (): kotlin.String declared in kotlin.Any + $this: VALUE_PARAMETER name: type:.A + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .A' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String 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.toString' type=.A origin=null PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.A, $receiver:T of .A.) returnType:T of .I. + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.A, $receiver:T of .A.) returnType:T of .A. 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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.A - $receiver: VALUE_PARAMETER DELEGATED_MEMBER name: type:T of .A. + TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.A + $receiver: VALUE_PARAMETER name: type:T of .A. BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): T of .I. declared in .A' + RETURN type=kotlin.Nothing from='public open fun (): T of .A. 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 $receiver: GET_VAR ': T of .A. declared in .A.' type=T of .A. origin=null FIELD DELEGATE name:<$$delegate_0> type:.I 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: - 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/delegatedMembers.fir.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt index 3ed3b69eda8..53cbb989a23 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt @@ -41,31 +41,20 @@ FILE fqName: fileName:/delegatedMembers.kt FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test.Test>, x:kotlin.Int) returnType:kotlin.Unit overridden: public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test.Test> - VALUE_PARAMETER DELEGATED_MEMBER name:x index:0 type:kotlin.Int + $this: VALUE_PARAMETER name: type:.Test.Test> + VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun foo (x: kotlin.Int): 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.foo' type=.Test.Test> origin=null x: GET_VAR 'x: kotlin.Int declared in .Test.foo' type=kotlin.Int origin=null - PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int - correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] - overridden: - public abstract fun (): kotlin.Int declared in .IBase - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test.Test> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test' - 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: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:[kotlin.Any?] - $this: VALUE_PARAMETER DELEGATED_MEMBER name: type:.Test.Test> - 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 + TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] + $this: VALUE_PARAMETER name: type:.Test.Test> + VALUE_PARAMETER name:t index:0 type:TT of .Test + VALUE_PARAMETER 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 : @@ -73,17 +62,44 @@ FILE fqName: fileName:/delegatedMembers.kt receiver: GET_VAR ': .Test.Test> declared in .Test.qux' type=.Test.Test> 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] + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test.Test>, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.Test.Test> 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .Test' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean 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.equals' type=.Test.Test> origin=null + other: GET_VAR 'other: kotlin.Any? declared in .Test.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .Test' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' 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.hashCode' type=.Test.Test> origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .Test' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String 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.toString' type=.Test.Test> origin=null + PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test.Test>) returnType:kotlin.Int + correspondingProperty: PROPERTY DELEGATED_MEMBER name:bar visibility:public modality:OPEN [val] + overridden: + public abstract fun (): kotlin.Int declared in .IBase + $this: VALUE_PARAMETER name: type:.Test.Test> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test' + 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 + FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test> visibility:local [final] diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.txt index ac2ae9c130b..b01fe5a3155 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.txt @@ -87,53 +87,109 @@ FILE fqName: fileName:/rawTypeInSignature.kt SET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=kotlin.Unit origin=EQ receiver: GET_VAR ': .KRaw declared in .KRaw' type=.KRaw origin=null value: GET_VAR 'j: .JRaw declared in .KRaw.' type=.JRaw origin=null - FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final] - FUN FAKE_OVERRIDE name:takesRawList visibility:public modality:OPEN <> ($this:.JRaw, list:kotlin.collections.List<*>?) returnType:kotlin.Unit [fake_override] + FUN DELEGATED_MEMBER name:takesRawList visibility:public modality:OPEN <> ($this:.KRaw, list:kotlin.collections.List<*>?) returnType:kotlin.Unit overridden: public abstract fun takesRawList (list: kotlin.collections.List<*>?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw + $this: VALUE_PARAMETER name: type:.KRaw VALUE_PARAMETER name:list index:0 type:kotlin.collections.List<*>? - FUN FAKE_OVERRIDE name:returnsRawList visibility:public modality:OPEN <> ($this:.JRaw) returnType:kotlin.collections.List<*>? [fake_override] + BLOCK_BODY + CALL 'public abstract fun takesRawList (list: kotlin.collections.List<*>?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawList' type=.KRaw origin=null + list: GET_VAR 'list: kotlin.collections.List<*>? declared in .KRaw.takesRawList' type=kotlin.collections.List<*>? origin=null + FUN DELEGATED_MEMBER name:returnsRawList visibility:public modality:OPEN <> ($this:.KRaw) returnType:kotlin.collections.List<*>? overridden: public abstract fun returnsRawList (): kotlin.collections.List<*>? declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw - FUN FAKE_OVERRIDE name:takesRawGenericInv visibility:public modality:OPEN <> ($this:.JRaw, g:.GenericInv<*>?) returnType:kotlin.Unit [fake_override] + $this: VALUE_PARAMETER name: type:.KRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun returnsRawList (): kotlin.collections.List<*>? declared in .KRaw' + CALL 'public abstract fun returnsRawList (): kotlin.collections.List<*>? declared in .JRaw' type=kotlin.collections.List<*>? origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawList' type=.KRaw origin=null + FUN DELEGATED_MEMBER name:takesRawGenericInv visibility:public modality:OPEN <> ($this:.KRaw, g:.GenericInv<*>?) returnType:kotlin.Unit overridden: public abstract fun takesRawGenericInv (g: .GenericInv<*>?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw + $this: VALUE_PARAMETER name: type:.KRaw VALUE_PARAMETER name:g index:0 type:.GenericInv<*>? - FUN FAKE_OVERRIDE name:returnsRawGenericInv visibility:public modality:OPEN <> ($this:.JRaw) returnType:.GenericInv<*>? [fake_override] + BLOCK_BODY + CALL 'public abstract fun takesRawGenericInv (g: .GenericInv<*>?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericInv' type=.KRaw origin=null + g: GET_VAR 'g: .GenericInv<*>? declared in .KRaw.takesRawGenericInv' type=.GenericInv<*>? origin=null + FUN DELEGATED_MEMBER name:returnsRawGenericInv visibility:public modality:OPEN <> ($this:.KRaw) returnType:.GenericInv<*>? overridden: public abstract fun returnsRawGenericInv (): .GenericInv<*>? declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw - FUN FAKE_OVERRIDE name:takesRawGenericIn visibility:public modality:OPEN <> ($this:.JRaw, g:.GenericIn?) returnType:kotlin.Unit [fake_override] + $this: VALUE_PARAMETER name: type:.KRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun returnsRawGenericInv (): .GenericInv<*>? declared in .KRaw' + CALL 'public abstract fun returnsRawGenericInv (): .GenericInv<*>? declared in .JRaw' type=.GenericInv<*>? origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericInv' type=.KRaw origin=null + FUN DELEGATED_MEMBER name:takesRawGenericIn visibility:public modality:OPEN <> ($this:.KRaw, g:.GenericIn?) returnType:kotlin.Unit overridden: public abstract fun takesRawGenericIn (g: .GenericIn?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw + $this: VALUE_PARAMETER name: type:.KRaw VALUE_PARAMETER name:g index:0 type:.GenericIn? - FUN FAKE_OVERRIDE name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:.JRaw) returnType:.GenericIn? [fake_override] + BLOCK_BODY + CALL 'public abstract fun takesRawGenericIn (g: .GenericIn?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericIn' type=.KRaw origin=null + g: GET_VAR 'g: .GenericIn? declared in .KRaw.takesRawGenericIn' type=.GenericIn? origin=null + FUN DELEGATED_MEMBER name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:.KRaw) returnType:.GenericIn? overridden: public abstract fun returnsRawGenericIn (): .GenericIn? declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw - FUN FAKE_OVERRIDE name:takesRawGenericOut visibility:public modality:OPEN <> ($this:.JRaw, g:.GenericOut<*>?) returnType:kotlin.Unit [fake_override] + $this: VALUE_PARAMETER name: type:.KRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun returnsRawGenericIn (): .GenericIn? declared in .KRaw' + CALL 'public abstract fun returnsRawGenericIn (): .GenericIn? declared in .JRaw' type=.GenericIn? origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericIn' type=.KRaw origin=null + FUN DELEGATED_MEMBER name:takesRawGenericOut visibility:public modality:OPEN <> ($this:.KRaw, g:.GenericOut<*>?) returnType:kotlin.Unit overridden: public abstract fun takesRawGenericOut (g: .GenericOut<*>?): kotlin.Unit declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw + $this: VALUE_PARAMETER name: type:.KRaw VALUE_PARAMETER name:g index:0 type:.GenericOut<*>? - FUN FAKE_OVERRIDE name:returnsRawGenericOut visibility:public modality:OPEN <> ($this:.JRaw) returnType:.GenericOut<*>? [fake_override] + BLOCK_BODY + CALL 'public abstract fun takesRawGenericOut (g: .GenericOut<*>?): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericOut' type=.KRaw origin=null + g: GET_VAR 'g: .GenericOut<*>? declared in .KRaw.takesRawGenericOut' type=.GenericOut<*>? origin=null + FUN DELEGATED_MEMBER name:returnsRawGenericOut visibility:public modality:OPEN <> ($this:.KRaw) returnType:.GenericOut<*>? overridden: public abstract fun returnsRawGenericOut (): .GenericOut<*>? declared in .JRaw - $this: VALUE_PARAMETER name: type:.JRaw - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] + $this: VALUE_PARAMETER name: type:.KRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun returnsRawGenericOut (): .GenericOut<*>? declared in .KRaw' + CALL 'public abstract fun returnsRawGenericOut (): .GenericOut<*>? declared in .JRaw' type=.GenericOut<*>? origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericOut' type=.KRaw origin=null + FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.KRaw, other:kotlin.Any?) returnType:kotlin.Boolean [operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.KRaw 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] + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in .KRaw' + CALL 'public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any' type=kotlin.Boolean origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.equals' type=.KRaw origin=null + other: GET_VAR 'other: kotlin.Any? declared in .KRaw.equals' type=kotlin.Any? origin=null + FUN DELEGATED_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.KRaw) returnType:kotlin.Int overridden: public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] + $this: VALUE_PARAMETER name: type:.KRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .KRaw' + CALL 'public open fun hashCode (): kotlin.Int declared in kotlin.Any' type=kotlin.Int origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.hashCode' type=.KRaw origin=null + FUN DELEGATED_MEMBER name:toString visibility:public modality:OPEN <> ($this:.KRaw) returnType:kotlin.String overridden: public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any + $this: VALUE_PARAMETER name: type:.KRaw + BLOCK_BODY + RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .KRaw' + CALL 'public open fun toString (): kotlin.String declared in kotlin.Any' type=kotlin.String origin=null + $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + receiver: GET_VAR ': .KRaw declared in .KRaw.toString' type=.KRaw origin=null + FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]