diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index 3960f0d2dc4..5c8b40313e5 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -23,7 +23,6 @@ import org.jetbrains.kotlin.fir.resolve.* import org.jetbrains.kotlin.fir.resolve.calls.SyntheticPropertySymbol import org.jetbrains.kotlin.fir.resolve.providers.FirProvider import org.jetbrains.kotlin.fir.scopes.ProcessorAction -import org.jetbrains.kotlin.fir.scopes.impl.delegatedWrapperData import org.jetbrains.kotlin.fir.scopes.processDirectlyOverriddenFunctions import org.jetbrains.kotlin.fir.scopes.processDirectlyOverriddenProperties import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope @@ -239,10 +238,7 @@ internal fun FirSimpleFunction.generateOverriddenFunctionSymbols( return@processDirectlyOverriddenFunctions ProcessorAction.NEXT } - val unwrapped = - it.fir.delegatedWrapperData?.takeIf { it.containingClass == containingClass.symbol.toLookupTag() }?.wrapped?.symbol ?: it - - val overridden = declarationStorage.getIrFunctionSymbol(unwrapped.unwrapSubstitutionOverrides()) + val overridden = declarationStorage.getIrFunctionSymbol(it.unwrapSubstitutionOverrides()) overriddenSet += overridden as IrSimpleFunctionSymbol ProcessorAction.NEXT } 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 dc0bb655b8d..380d9ff6582 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 @@ -12,7 +12,6 @@ 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.StandardClassIds import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.ConeClassLikeType import org.jetbrains.kotlin.ir.declarations.* @@ -54,9 +53,6 @@ internal class DelegatedMemberGenerator( if (isJavaDefault(unwrapped)) { return@processAllFunctions } - if (firSubClass is FirRegularClass && firSubClass.isData && unwrapped.symbol.callableId.classId == StandardClassIds.Any) { - return@processAllFunctions - } val irSubFunction = generateDelegatedFunction( subClass, firSubClass, irField, member, functionSymbol.fir diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SamResolution.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SamResolution.kt index a5e435f198a..0d844106096 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SamResolution.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SamResolution.kt @@ -17,6 +17,7 @@ import org.jetbrains.kotlin.fir.declarations.impl.FirDeclarationStatusImpl import org.jetbrains.kotlin.fir.diagnostics.ConeIntermediateDiagnostic import org.jetbrains.kotlin.fir.resolve.calls.FirSyntheticFunctionSymbol import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap +import org.jetbrains.kotlin.fir.scopes.impl.hasTypeOf import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.StandardClassIds @@ -29,7 +30,6 @@ import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.impl.ConeClassLikeTypeImpl import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl -import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.types.Variance @@ -337,17 +337,6 @@ fun FirSimpleFunction.isPublicInObject(checkOnlyName: Boolean): Boolean { } } -private fun FirValueParameter.hasTypeOf(classId: ClassId, allowNullable: Boolean): Boolean { - val classLike = when (val type = returnTypeRef.coneType) { - is ConeClassLikeType -> type - is ConeFlexibleType -> type.upperBound as? ConeClassLikeType ?: return false - else -> return false - } - - if (classLike.isMarkedNullable && !allowNullable) return false - return classLike.lookupTag.classId == classId -} - private val PUBLIC_METHOD_NAMES_IN_OBJECT = setOf("equals", "hashCode", "getClass", "wait", "notify", "notifyAll", "toString") private fun FirSimpleFunction.getFunctionTypeForAbstractMethod(): ConeLookupTagBasedType { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/KotlinScopeProvider.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/KotlinScopeProvider.kt index 50f5b0e8bbd..14632038c67 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/KotlinScopeProvider.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/KotlinScopeProvider.kt @@ -47,7 +47,8 @@ class KotlinScopeProvider( symbol.fir.scopeForSupertype( substitutor(symbol, useSiteSuperType, useSiteSession), useSiteSession, scopeSession, delegateField, - subClass = klass + subClass = klass, + decoratedDeclaredMemberScope ).let { it as? FirTypeScope ?: error("$it is expected to be FirOverrideAwareScope") } @@ -122,7 +123,8 @@ private fun FirClass<*>.scopeForSupertype( useSiteSession: FirSession, scopeSession: ScopeSession, delegateField: FirField?, - subClass: FirClass<*> + subClass: FirClass<*>, + declaredMemberScope: FirScope, ): FirTypeScope = scopeForClassImpl( substitutor, useSiteSession, @@ -133,7 +135,7 @@ private fun FirClass<*>.scopeForSupertype( ).let { if (delegateField != null) { scopeSession.getOrBuild(delegateField, DelegatedMemberScopeKey(delegateField.symbol.callableId)) { - FirDelegatedMemberScope(it, useSiteSession, subClass, delegateField) + FirDelegatedMemberScope(it, useSiteSession, subClass, delegateField, declaredMemberScope) } } else { it diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDelegatedMemberScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDelegatedMemberScope.kt index 9614936addc..569ed070e76 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDelegatedMemberScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirDelegatedMemberScope.kt @@ -6,13 +6,19 @@ package org.jetbrains.kotlin.fir.scopes.impl import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.resolve.defaultType -import org.jetbrains.kotlin.fir.scopes.FirTypeScope -import org.jetbrains.kotlin.fir.scopes.ProcessorAction +import org.jetbrains.kotlin.fir.scopes.* import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag +import org.jetbrains.kotlin.fir.symbols.StandardClassIds import org.jetbrains.kotlin.fir.symbols.impl.* +import org.jetbrains.kotlin.fir.types.ConeClassLikeType +import org.jetbrains.kotlin.fir.types.ConeFlexibleType +import org.jetbrains.kotlin.fir.types.coneType +import org.jetbrains.kotlin.fir.types.isMarkedNullable +import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name class FirDelegatedMemberScope( @@ -20,22 +26,31 @@ class FirDelegatedMemberScope( private val session: FirSession, private val containingClass: FirClass<*>, private val delegateField: FirField, + private val declaredMemberScope: FirScope, ) : FirTypeScope() { private val delegatedFunctionCache = mutableMapOf() private val delegatedPropertyCache = mutableMapOf() private val dispatchReceiverType = containingClass.defaultType() + private val overrideChecker = FirStandardOverrideChecker(session) override fun processFunctionsByName(name: Name, processor: (FirFunctionSymbol<*>) -> Unit) { useSiteScope.processFunctionsByName(name) processor@{ functionSymbol -> - if (functionSymbol !is FirNamedFunctionSymbol) { + if (functionSymbol !is FirNamedFunctionSymbol || functionSymbol.fir.isPublicInAny()) { processor(functionSymbol) return@processor } + val original = functionSymbol.fir - if (original.modality == Modality.FINAL) { + if (original.modality == Modality.FINAL || original.visibility == Visibilities.Private) { processor(functionSymbol) return@processor } + + if (declaredMemberScope.getFunctions(name).any { it is FirNamedFunctionSymbol && overrideChecker.isOverriddenFunction(it.fir, original) }) { + processor(functionSymbol) + return@processor + } + val delegatedSymbol = delegatedFunctionCache.getOrPut(functionSymbol) { val newSymbol = FirNamedFunctionSymbol( functionSymbol.callableId, @@ -61,11 +76,19 @@ class FirDelegatedMemberScope( processor(propertySymbol) return@processor } + val original = propertySymbol.fir - if (original.modality == Modality.FINAL) { + + if (original.modality == Modality.FINAL || original.visibility == Visibilities.Private) { processor(propertySymbol) return@processor } + + if (declaredMemberScope.getProperties(name).any { it is FirPropertySymbol && overrideChecker.isOverriddenProperty(it.fir, original) }) { + processor(propertySymbol) + return@processor + } + val delegatedSymbol = delegatedPropertyCache.getOrPut(propertySymbol) { FirFakeOverrideGenerator.createCopyForFirProperty( FirPropertySymbol( @@ -133,3 +156,31 @@ class DelegatedWrapperData>( ) var > D.delegatedWrapperData: DelegatedWrapperData? by FirDeclarationDataRegistry.data(DelegatedWrapperDataKey) + + +// From the definition of function interfaces in the Java specification (pt. 9.8): +// "methods that are members of I that do not have the same signature as any public instance method of the class Object" +// It means that if an interface declares `int hashCode()` then the method won't be taken into account when +// checking if the interface is SAM. +fun FirSimpleFunction.isPublicInAny(): Boolean { + if (name.asString() !in PUBLIC_METHOD_NAMES_IN_ANY) return false + + return when (name.asString()) { + "hashCode", "toString" -> valueParameters.isEmpty() + "equals" -> valueParameters.singleOrNull()?.hasTypeOf(StandardClassIds.Any, allowNullable = true) == true + else -> error("Unexpected method name: $name") + } +} + +fun FirValueParameter.hasTypeOf(classId: ClassId, allowNullable: Boolean): Boolean { + val classLike = when (val type = returnTypeRef.coneType) { + is ConeClassLikeType -> type + is ConeFlexibleType -> type.upperBound as? ConeClassLikeType ?: return false + else -> return false + } + + if (classLike.isMarkedNullable && !allowNullable) return false + return classLike.lookupTag.classId == classId +} + +private val PUBLIC_METHOD_NAMES_IN_ANY = setOf("equals", "hashCode", "toString") diff --git a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirScope.kt b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirScope.kt index 533a509d3c8..ef5edfa1019 100644 --- a/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirScope.kt +++ b/compiler/fir/tree/src/org/jetbrains/kotlin/fir/scopes/FirScope.kt @@ -35,6 +35,14 @@ abstract class FirScope { open fun mayContainName(name: Name) = true } +fun FirScope.getFunctions(name: Name): List> = mutableListOf>().apply { + processFunctionsByName(name, this::add) +} + +fun FirScope.getProperties(name: Name): List> = mutableListOf>().apply { + processPropertiesByName(name, this::add) +} + fun FirTypeScope.processOverriddenFunctionsAndSelf( functionSymbol: FirFunctionSymbol<*>, processor: (FirFunctionSymbol<*>) -> ProcessorAction diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt index 865f37c1eeb..ccdc5eb4067 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.txt @@ -63,35 +63,6 @@ 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.Test1, C of .Test1.>? correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] @@ -138,6 +109,19 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt $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] @@ -181,35 +165,6 @@ 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.Test2.>? correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] @@ -256,3 +211,16 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt $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 1f7658a66b0..cdb02665cd0 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.txt @@ -234,36 +234,20 @@ FILE fqName: fileName:/delegatedImplementation.kt $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 - FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.Test1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + 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:.Test1 + $this: VALUE_PARAMETER name: type:kotlin.Any 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 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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any 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] @@ -309,35 +293,6 @@ FILE fqName: fileName:/delegatedImplementation.kt $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 @@ -412,3 +367,16 @@ 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 dd5d8c80a02..fa36ada9640 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.txt @@ -77,33 +77,17 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt 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] + FIELD DELEGATE name:<$$delegate_0> type:.J 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:.Test + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt index 3265f6c05ef..a30487d58ad 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.txt @@ -69,33 +69,17 @@ FILE fqName: fileName:/delegatedImplementationWithExplicitOverride.kt 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 - FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.C, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.C + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt index c7858df0dce..cb48aec5b08 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.txt @@ -136,36 +136,20 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt 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 - FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestJFoo, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestJFoo + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK1 CONSTRUCTOR visibility:public <> () returnType:.TestK1 [primary] @@ -184,36 +168,20 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt 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 - FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK1, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestK1 + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK2 CONSTRUCTOR visibility:public <> () returnType:.TestK2 [primary] @@ -232,36 +200,20 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt 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 - FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK2, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestK2 + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK3 CONSTRUCTOR visibility:public <> () returnType:.TestK3 [primary] @@ -280,36 +232,20 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt 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 - FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK3, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestK3 + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[.IFoo] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestK4 CONSTRUCTOR visibility:public <> () returnType:.TestK4 [primary] @@ -328,33 +264,17 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt 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 - FUN DELEGATED_MEMBER name:equals visibility:public modality:OPEN <> ($this:.TestK4, other:kotlin.Any?) returnType:kotlin.Boolean [operator] + 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.TestK4 + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.txt index c291ac2f8ec..fca54190d10 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.txt @@ -33,35 +33,6 @@ 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 .A. correspondingProperty: PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] @@ -78,3 +49,16 @@ FILE fqName: fileName:/kt35550.kt 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 53cbb989a23..2e25ff1cdb9 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.txt @@ -62,35 +62,6 @@ 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 - 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:.Test.Test> - 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 .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:.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:.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] @@ -103,3 +74,16 @@ FILE fqName: fileName:/delegatedMembers.kt $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] + 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/types/javaWildcardType.fir.txt b/compiler/testData/ir/irText/types/javaWildcardType.fir.txt index 5dc5a48b9b0..256454833dd 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.fir.txt +++ b/compiler/testData/ir/irText/types/javaWildcardType.fir.txt @@ -76,35 +76,6 @@ FILE fqName: fileName:/javaWildcardType.kt $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null receiver: GET_VAR ': .C declared in .C.jg2' type=.C origin=null c: GET_VAR 'c: kotlin.collections.Collection? declared in .C.jg2' type=kotlin.collections.Collection? origin=null - 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:.C - 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 .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:.J visibility:local [final]' type=.J 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:.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:.J visibility:local [final]' type=.J 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:.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:.J visibility:local [final]' type=.J origin=null - receiver: GET_VAR ': .C declared in .C.toString' type=.C origin=null FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final] FUN DELEGATED_MEMBER name:kf1 visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.collections.Collection overridden: @@ -145,3 +116,16 @@ FILE fqName: fileName:/javaWildcardType.kt receiver: GET_VAR ': .C declared in .C.kg2' type=.C origin=null c: GET_VAR 'c: kotlin.collections.Collection declared in .C.kg2' type=kotlin.collections.Collection origin=null FIELD DELEGATE name:<$$delegate_1> type:.K 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/types/rawTypeInSignature.fir.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.txt index b01fe5a3155..30b0c189dc0 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.txt @@ -163,33 +163,17 @@ FILE fqName: fileName:/rawTypeInSignature.kt 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] + FIELD DELEGATE name:<$$delegate_0> type:.JRaw 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:.KRaw + $this: VALUE_PARAMETER name: type:kotlin.Any 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 .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 + 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:.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 + $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:.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] + $this: VALUE_PARAMETER name: type:kotlin.Any