From 096dc2570198b88fd9d342a1a8a8444abdf07861 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 26 Feb 2020 15:42:12 +0300 Subject: [PATCH] FIR: change callableId of fake overrides to derived class owner --- .../kotlin/fir/backend/ConversionUtils.kt | 5 +++ .../fir/backend/Fir2IrDeclarationStorage.kt | 10 ++--- .../kotlin/fir/backend/Fir2IrVisitor.kt | 2 +- .../kotlin/fir/java/JavaScopeProvider.kt | 4 +- .../kotlin/fir/resolve/SupertypeUtils.kt | 12 ++++-- .../kotlin/fir/scopes/KotlinScopeProvider.kt | 15 +++++--- .../scopes/impl/FirClassSubstitutionScope.kt | 38 +++++++++++++------ .../resolve/testData/resolve/bareTypes.txt | 2 +- .../resolve/expresssions/genericDecorator.txt | 2 +- .../expresssions/genericDiagnostic.txt | 2 +- .../expresssions/genericPropertyAccess.txt | 2 +- .../resolve/expresssions/importedReceiver.txt | 2 +- .../testData/resolve/genericConstructors.txt | 2 +- .../resolve/overrides/protobufExt.txt | 2 +- .../resolve/overrides/simpleFakeOverride.txt | 2 +- .../resolve/overrides/supertypeGenerics.txt | 2 +- .../overrides/supertypeGenericsComplex.txt | 4 +- .../resolve/stdlib/j+k/flexibleWildcard.txt | 2 +- .../addAllOnJavaCollection.txt | 2 +- .../callableReferences/ifWithCR.txt | 2 +- .../j+k/FieldSubstitution.txt | 2 +- .../j+k/KJKComplexHierarchyWithNested.txt | 4 +- .../j+k/KJKInheritanceGeneric.txt | 2 +- .../resolveWithStdlib/j+k/MyIterable.txt | 4 +- .../testData/resolveWithStdlib/j+k/MyMap.txt | 8 ++-- .../testData/resolveWithStdlib/problems.txt | 2 +- .../resolveWithStdlib/removeOnAbstractMap.txt | 2 +- .../typeAliasDeserialization.txt | 2 +- .../typeParameterDerived.txt | 2 +- .../function/booleanNotIntrinsic.kt | 1 - .../function/nestedConstructorFromClass.kt | 1 - .../intrinsics/throwableCallableReference.kt | 1 - .../ir/irText/expressions/kt30020.fir.txt | 12 +++--- .../expressions/useImportedMember.fir.txt | 5 ++- .../ir/irText/stubs/builtinMap.fir.txt | 2 +- .../genericClassInDifferentModule_m2.fir.txt | 4 +- .../enhancedNullabilityInForLoop.fir.txt | 16 ++++---- 37 files changed, 107 insertions(+), 77 deletions(-) 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 7b128fdfcdb..95b7c090d9a 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 @@ -267,3 +267,8 @@ private fun FirTypeRef.collectCallableNamesFromThisAndSupertypes( } return result } + +internal tailrec fun FirCallableSymbol<*>.deepestOverriddenSymbol(): FirCallableSymbol<*> { + val overriddenSymbol = overriddenSymbol ?: return this + return overriddenSymbol.deepestOverriddenSymbol() +} \ No newline at end of file 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 54e8d195233..faa4f802225 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 @@ -557,6 +557,11 @@ class Fir2IrDeclarationStorage( return if (shouldLeaveScope) cached else cached.enterLocalScope(function) } val created = create() + if (function.symbol.callableId.isKFunctionInvoke()) { + (function.symbol.overriddenSymbol as? FirNamedFunctionSymbol)?.let { + created.overriddenSymbols += (it.toFunctionSymbol(this) as IrSimpleFunctionSymbol) + } + } functionCache[function] = created return created } @@ -902,11 +907,6 @@ class Fir2IrDeclarationStorage( val irDeclaration = getIrFunction(firDeclaration, irParent, shouldLeaveScope = true).apply { setAndModifyParent(irParent) } - if (firFunctionSymbol.callableId.isKFunctionInvoke()) { - (firFunctionSymbol.overriddenSymbol as? FirNamedFunctionSymbol)?.let { - irDeclaration.overriddenSymbols += (it.toFunctionSymbol(this) as IrSimpleFunctionSymbol) - } - } irSymbolTable.referenceSimpleFunction(irDeclaration.descriptor) } is FirAnonymousFunction -> { diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt index d20453207f9..d7a9b41fd0a 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrVisitor.kt @@ -318,7 +318,7 @@ class Fir2IrVisitor( val containingClass = if (firOverriddenSymbol == null || firFunctionSymbol == null) { lastClass } else { - val callableId = firFunctionSymbol.callableId + val callableId = firFunctionSymbol.deepestOverriddenSymbol().callableId val ownerClassId = callableId.classId if (ownerClassId == null) { lastClass diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt index 677d5e36b43..7593146199f 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaScopeProvider.kt @@ -77,7 +77,9 @@ class JavaScopeProvider( // We need JavaClassEnhancementScope here to have already enhanced signatures from supertypes val scope = buildJavaEnhancementScope(useSiteSession, symbol, scopeSession, visitedSymbols) visitedSymbols.remove(symbol) - useSiteSuperType.wrapSubstitutionScopeIfNeed(useSiteSession, scope, symbol.fir, scopeSession) + useSiteSuperType.wrapSubstitutionScopeIfNeed( + useSiteSession, scope, symbol.fir, scopeSession, regularClass.classId + ) } else { null } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SupertypeUtils.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SupertypeUtils.kt index c35af123fa8..0288985e1a1 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SupertypeUtils.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/SupertypeUtils.kt @@ -15,6 +15,7 @@ import org.jetbrains.kotlin.fir.scopes.impl.FirClassSubstitutionScope import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.* +import org.jetbrains.kotlin.name.ClassId abstract class SupertypeSupplier { abstract fun forClass(firClass: FirClass<*>): List @@ -80,7 +81,8 @@ fun ConeClassLikeType.wrapSubstitutionScopeIfNeed( session: FirSession, useSiteMemberScope: FirScope, declaration: FirClassLikeDeclaration<*>, - builder: ScopeSession + builder: ScopeSession, + derivedClassId: ClassId? = null ): FirScope { if (this.typeArguments.isEmpty()) return useSiteMemberScope return builder.getOrBuild(declaration.symbol, SubstitutionScopeKey(this)) { @@ -95,10 +97,14 @@ fun ConeClassLikeType.wrapSubstitutionScopeIfNeed( val javaTypeParameters = javaClass.typeParameters val javaSubstitution = createSubstitution(javaTypeParameters, typeArguments, session) FirClassSubstitutionScope( - session, useSiteMemberScope, builder, originalSubstitution + javaSubstitution, skipPrivateMembers = true + session, useSiteMemberScope, builder, originalSubstitution + javaSubstitution, + skipPrivateMembers = true, derivedClassId = derivedClassId ) } else { - FirClassSubstitutionScope(session, useSiteMemberScope, builder, originalSubstitution, skipPrivateMembers = true) + FirClassSubstitutionScope( + session, useSiteMemberScope, builder, originalSubstitution, + skipPrivateMembers = true, derivedClassId = derivedClassId + ) } } } 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 3f84d557a86..d0395c20160 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 @@ -8,6 +8,7 @@ package org.jetbrains.kotlin.fir.scopes import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.FirClass +import org.jetbrains.kotlin.fir.declarations.classId import org.jetbrains.kotlin.fir.resolve.* import org.jetbrains.kotlin.fir.resolve.substitution.ConeSubstitutor import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap @@ -15,6 +16,7 @@ import org.jetbrains.kotlin.fir.scopes.impl.* import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol import org.jetbrains.kotlin.fir.types.ConeClassErrorType import org.jetbrains.kotlin.fir.types.ConeClassLikeType +import org.jetbrains.kotlin.name.ClassId class KotlinScopeProvider( val declaredMemberScopeDecorator: ( @@ -49,7 +51,7 @@ class KotlinScopeProvider( if (symbol is FirRegularClassSymbol) { symbol.fir.scope( substitutor(symbol, useSiteSuperType, useSiteSession), - useSiteSession, scopeSession, skipPrivateMembers = true + useSiteSession, scopeSession, skipPrivateMembers = true, klass.classId ) } else { null @@ -80,7 +82,9 @@ class KotlinScopeProvider( } -data class ConeSubstitutionScopeKey(val substitutor: ConeSubstitutor) : ScopeSessionKey, FirClassSubstitutionScope>() +data class ConeSubstitutionScopeKey( + val classId: ClassId?, val substitutor: ConeSubstitutor +) : ScopeSessionKey, FirClassSubstitutionScope>() fun FirClass<*>.unsubstitutedScope(useSiteSession: FirSession, scopeSession: ScopeSession): FirScope { return scopeProvider.getUseSiteMemberScope(this, useSiteSession, scopeSession) @@ -90,7 +94,8 @@ internal fun FirClass<*>.scope( substitutor: ConeSubstitutor, useSiteSession: FirSession, scopeSession: ScopeSession, - skipPrivateMembers: Boolean + skipPrivateMembers: Boolean, + classId: ClassId? = null ): FirScope { val basicScope = scopeProvider.getUseSiteMemberScope( this, useSiteSession, scopeSession @@ -98,8 +103,8 @@ internal fun FirClass<*>.scope( if (substitutor == ConeSubstitutor.Empty) return basicScope return scopeSession.getOrBuild( - this, ConeSubstitutionScopeKey(substitutor) + this, ConeSubstitutionScopeKey(classId, substitutor) ) { - FirClassSubstitutionScope(useSiteSession, basicScope, scopeSession, substitutor, skipPrivateMembers) + FirClassSubstitutionScope(useSiteSession, basicScope, scopeSession, substitutor, skipPrivateMembers, classId) } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt index e677cbec76b..d64d3071dba 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/scopes/impl/FirClassSubstitutionScope.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.resolve.substitution.substitutorByMap import org.jetbrains.kotlin.fir.resolve.transformers.ReturnTypeCalculator import org.jetbrains.kotlin.fir.resolve.transformers.ReturnTypeCalculatorForFullBodyResolve import org.jetbrains.kotlin.fir.scopes.FirScope +import org.jetbrains.kotlin.fir.symbols.CallableId import org.jetbrains.kotlin.fir.symbols.impl.* import org.jetbrains.kotlin.fir.types.ConeKotlinType import org.jetbrains.kotlin.fir.types.FirResolvedTypeRef @@ -25,6 +26,7 @@ import org.jetbrains.kotlin.fir.types.FirTypeRef import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.coneTypeUnsafe import org.jetbrains.kotlin.fir.types.impl.ConeTypeParameterTypeImpl +import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name class FirClassSubstitutionScope( @@ -32,7 +34,8 @@ class FirClassSubstitutionScope( private val useSiteMemberScope: FirScope, scopeSession: ScopeSession, private val substitutor: ConeSubstitutor, - private val skipPrivateMembers: Boolean + private val skipPrivateMembers: Boolean, + private val derivedClassId: ClassId? = null ) : FirScope() { private val fakeOverrideFunctions = mutableMapOf, FirFunctionSymbol<*>>() @@ -43,8 +46,8 @@ class FirClassSubstitutionScope( constructor( session: FirSession, useSiteMemberScope: FirScope, scopeSession: ScopeSession, substitution: Map, - skipPrivateMembers: Boolean - ) : this(session, useSiteMemberScope, scopeSession, substitutorByMap(substitution), skipPrivateMembers) + skipPrivateMembers: Boolean, derivedClassId: ClassId? = null + ) : this(session, useSiteMemberScope, scopeSession, substitutorByMap(substitution), skipPrivateMembers, derivedClassId) override fun processFunctionsByName(name: Name, processor: (FirFunctionSymbol<*>) -> Unit) { useSiteMemberScope.processFunctionsByName(name) process@{ original -> @@ -121,7 +124,7 @@ class FirClassSubstitutionScope( } return createFakeOverrideFunction( - session, member, original, newReceiverType, newReturnType, newParameterTypes, newTypeParameters + session, member, original, newReceiverType, newReturnType, newParameterTypes, newTypeParameters, derivedClassId ) } @@ -183,7 +186,7 @@ class FirClassSubstitutionScope( return original } - return createFakeOverrideProperty(session, member, original, newReceiverType, newReturnType) + return createFakeOverrideProperty(session, member, original, newReceiverType, newReturnType, derivedClassId) } private fun createFakeOverrideField(original: FirFieldSymbol): FirFieldSymbol { @@ -194,7 +197,7 @@ class FirClassSubstitutionScope( val returnType = typeCalculator.tryCalculateReturnType(member).type val newReturnType = returnType.substitute() ?: return original - return createFakeOverrideField(session, member, original, newReturnType) + return createFakeOverrideField(session, member, original, newReturnType, derivedClassId) } private fun createFakeOverrideAccessor(original: FirAccessorSymbol): FirAccessorSymbol { @@ -272,9 +275,13 @@ class FirClassSubstitutionScope( newReceiverType: ConeKotlinType? = null, newReturnType: ConeKotlinType? = null, newParameterTypes: List? = null, - newTypeParameters: List? = null + newTypeParameters: List? = null, + derivedClassId: ClassId? = null ): FirNamedFunctionSymbol { - val symbol = FirNamedFunctionSymbol(baseSymbol.callableId, true, baseSymbol) + val symbol = FirNamedFunctionSymbol( + CallableId(derivedClassId ?: baseSymbol.callableId.classId!!, baseFunction.name), + isFakeOverride = true, overriddenSymbol = baseSymbol + ) createFakeOverrideFunction( symbol, session, baseFunction, newReceiverType, newReturnType, newParameterTypes, newTypeParameters ) @@ -286,9 +293,13 @@ class FirClassSubstitutionScope( baseProperty: FirProperty, baseSymbol: FirPropertySymbol, newReceiverType: ConeKotlinType? = null, - newReturnType: ConeKotlinType? = null + newReturnType: ConeKotlinType? = null, + derivedClassId: ClassId? = null ): FirPropertySymbol { - val symbol = FirPropertySymbol(baseSymbol.callableId, true, baseSymbol) + val symbol = FirPropertySymbol( + CallableId(derivedClassId ?: baseSymbol.callableId.classId!!, baseProperty.name), + isFakeOverride = true, overriddenSymbol = baseSymbol + ) buildProperty { source = baseProperty.source this.session = session @@ -309,9 +320,12 @@ class FirClassSubstitutionScope( session: FirSession, baseField: FirField, baseSymbol: FirFieldSymbol, - newReturnType: ConeKotlinType? = null + newReturnType: ConeKotlinType? = null, + derivedClassId: ClassId? = null ): FirFieldSymbol { - val symbol = FirFieldSymbol(baseSymbol.callableId) + val symbol = FirFieldSymbol( + CallableId(derivedClassId ?: baseSymbol.callableId.classId!!, baseField.name) + ) buildField { source = baseField.source this.session = session diff --git a/compiler/fir/resolve/testData/resolve/bareTypes.txt b/compiler/fir/resolve/testData/resolve/bareTypes.txt index 25a360dacce..e1ec7db4443 100644 --- a/compiler/fir/resolve/testData/resolve/bareTypes.txt +++ b/compiler/fir/resolve/testData/resolve/bareTypes.txt @@ -13,7 +13,7 @@ FILE: bareTypes.kt } public final fun test2(a: R|A|): R|kotlin/Unit| { lval b: R|MutableString| = (R|/a| as R|MutableString|) - R|/b|.R|FakeOverride|(String()) + R|/b|.R|FakeOverride|(String()) } public final fun test3(a: R|A|): R|kotlin/Unit| { when () { diff --git a/compiler/fir/resolve/testData/resolve/expresssions/genericDecorator.txt b/compiler/fir/resolve/testData/resolve/expresssions/genericDecorator.txt index d557863c8db..e158b5aaf6a 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/genericDecorator.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/genericDecorator.txt @@ -5,7 +5,7 @@ FILE: test.kt } public final override fun getLookupString(): R|kotlin/String| { - ^getLookupString this@R|/MyDecorator|.R|/Decorator.delegate|.R|/LookupElement.lookupString| + ^getLookupString this@R|/MyDecorator|.R|/MyDecorator.delegate|.R|/LookupElement.lookupString| } } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt b/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt index add029a2d52..ad1b07ac01e 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/genericDiagnostic.txt @@ -16,7 +16,7 @@ FILE: test.kt private final val DERIVED_FACTORY: R|DiagnosticFactory0| = R|/DiagnosticFactory0.DiagnosticFactory0|() private get(): R|DiagnosticFactory0| public final fun createViaFactory(d: R|EmptyDiagnostic|): R|kotlin/Unit| { - lval casted: R|Diagnostic!>| = R|/DERIVED_FACTORY|.R|FakeOverride!>|>|(R|/d|) + lval casted: R|Diagnostic!>| = R|/DERIVED_FACTORY|.R|FakeOverride!>|>|(R|/d|) lval element: R|DerivedElement| = R|/casted|.R|/Diagnostic.element| R|/Fix.Fix|(R|/element|) } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/genericPropertyAccess.txt b/compiler/fir/resolve/testData/resolve/expresssions/genericPropertyAccess.txt index 31dd6da56e9..3d7076022f0 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/genericPropertyAccess.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/genericPropertyAccess.txt @@ -16,7 +16,7 @@ FILE: genericPropertyAccess.kt } public final override fun foo(): R|T| { - ^foo this@R|/Derived|.R|FakeOverride| + ^foo this@R|/Derived|.R|FakeOverride| } } diff --git a/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt b/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt index dfeea57225b..608f6632ade 100644 --- a/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt +++ b/compiler/fir/resolve/testData/resolve/expresssions/importedReceiver.txt @@ -31,5 +31,5 @@ FILE: importedReceiver.kt R|/My.baz|() Boolean(true).R|/My.gau|() R|/Your.wat|() - Boolean(false).R|FakeOverride|() + Boolean(false).R|FakeOverride|() } diff --git a/compiler/fir/resolve/testData/resolve/genericConstructors.txt b/compiler/fir/resolve/testData/resolve/genericConstructors.txt index 7ae06be73ea..44984e9ec4d 100644 --- a/compiler/fir/resolve/testData/resolve/genericConstructors.txt +++ b/compiler/fir/resolve/testData/resolve/genericConstructors.txt @@ -30,7 +30,7 @@ FILE: genericConstructors.kt } public final fun bar(): R|kotlin/Unit| { - this@R|/C|.R|FakeOverride|>|.R|FakeOverride|(String()) + this@R|/C|.R|FakeOverride|>|.R|FakeOverride|(String()) } } diff --git a/compiler/fir/resolve/testData/resolve/overrides/protobufExt.txt b/compiler/fir/resolve/testData/resolve/overrides/protobufExt.txt index 47019662d3c..cc30caa9158 100644 --- a/compiler/fir/resolve/testData/resolve/overrides/protobufExt.txt +++ b/compiler/fir/resolve/testData/resolve/overrides/protobufExt.txt @@ -21,6 +21,6 @@ FILE: protobufExt.kt ^extF this@R|/extF|.R|FakeOverride|(R|/e|) } public final fun foo(m: R|MyMessage|, e: R|MyExt|): R|kotlin/Unit| { - R|/m|.R|FakeOverride|(R|/e|) + R|/m|.R|FakeOverride|(R|/e|) R|/m|.R|/extF|(R|/e|) } diff --git a/compiler/fir/resolve/testData/resolve/overrides/simpleFakeOverride.txt b/compiler/fir/resolve/testData/resolve/overrides/simpleFakeOverride.txt index f6b858a9a52..1b09bc74cfa 100644 --- a/compiler/fir/resolve/testData/resolve/overrides/simpleFakeOverride.txt +++ b/compiler/fir/resolve/testData/resolve/overrides/simpleFakeOverride.txt @@ -21,7 +21,7 @@ FILE: simpleFakeOverride.kt } public final fun test(): R|kotlin/Unit| { - this@R|/B|.R|FakeOverride|(R|/Some.Some|()) + this@R|/B|.R|FakeOverride|(R|/Some.Some|()) } } diff --git a/compiler/fir/resolve/testData/resolve/overrides/supertypeGenerics.txt b/compiler/fir/resolve/testData/resolve/overrides/supertypeGenerics.txt index f10ddd67a1e..d149a8ce125 100644 --- a/compiler/fir/resolve/testData/resolve/overrides/supertypeGenerics.txt +++ b/compiler/fir/resolve/testData/resolve/overrides/supertypeGenerics.txt @@ -19,5 +19,5 @@ FILE: supertypeGenerics.kt } public final fun f(list: R|kotlin/collections/List|, s: R|kotlin/collections/List|): R|kotlin/Unit| { - R|/C.C|().R|FakeOverride|(R|/list|, R|/s|) + R|/C.C|().R|FakeOverride|(R|/list|, R|/s|) } diff --git a/compiler/fir/resolve/testData/resolve/overrides/supertypeGenericsComplex.txt b/compiler/fir/resolve/testData/resolve/overrides/supertypeGenericsComplex.txt index f5e1457bc22..2580c3deb05 100644 --- a/compiler/fir/resolve/testData/resolve/overrides/supertypeGenericsComplex.txt +++ b/compiler/fir/resolve/testData/resolve/overrides/supertypeGenericsComplex.txt @@ -23,6 +23,6 @@ FILE: supertypeGenericsComplex.kt } public final fun f(list: R|kotlin/collections/MutableList|, s: R|kotlin/collections/MutableList|): R|kotlin/Unit| { - R|/C.C|().R|FakeOverride|(R|/list|, R|/s|) - R|/C.C|().#(R|/s|, R|/list|) + R|/C.C|().R|FakeOverride|(R|/list|, R|/s|) + R|/C.C|().#(R|/s|, R|/list|) } diff --git a/compiler/fir/resolve/testData/resolve/stdlib/j+k/flexibleWildcard.txt b/compiler/fir/resolve/testData/resolve/stdlib/j+k/flexibleWildcard.txt index c72516f6fa2..cd59407f376 100644 --- a/compiler/fir/resolve/testData/resolve/stdlib/j+k/flexibleWildcard.txt +++ b/compiler/fir/resolve/testData/resolve/stdlib/j+k/flexibleWildcard.txt @@ -1,5 +1,5 @@ FILE: main.kt public final fun main(x: R|kotlin/collections/MutableCollection>|): R|kotlin/Unit| { lval y: R|ft!>, kotlin/collections/List!>?>!| = Q|ContainerUtil|.R|/ContainerUtil.flatten|!|>(R|/x|) - R|/y|.R|FakeOverride!|>|(Int(0)).R|kotlin/String.length| + R|/y|.R|FakeOverride!|>|(Int(0)).R|kotlin/String.length| } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/addAllOnJavaCollection.txt b/compiler/fir/resolve/testData/resolveWithStdlib/addAllOnJavaCollection.txt index cf50df136e3..3641a3d6a9b 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/addAllOnJavaCollection.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/addAllOnJavaCollection.txt @@ -2,7 +2,7 @@ FILE: addAllOnJavaCollection.kt public final fun foo(): R|kotlin/Unit| { lval y: R|kotlin/collections/List| = R|kotlin/collections/listOf|(vararg(String(Alpha), String(Beta))) lval x: R|java/util/LinkedHashSet| = R|java/util/LinkedHashSet.LinkedHashSet|().R|kotlin/apply||>( = apply@fun R|java/util/LinkedHashSet|.(): R|kotlin/Unit| { - ^ this@R|special/anonymous|.R|FakeOverride|(R|/y|) + ^ this@R|special/anonymous|.R|FakeOverride|(R|/y|) } ) lval z: R|java/util/ArrayList| = R|java/util/ArrayList.ArrayList|() diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/callableReferences/ifWithCR.txt b/compiler/fir/resolve/testData/resolveWithStdlib/callableReferences/ifWithCR.txt index f032f5ec90a..1c0ffaeb609 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/callableReferences/ifWithCR.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/callableReferences/ifWithCR.txt @@ -19,5 +19,5 @@ FILE: ifWithCR.kt } } - R|/x|.R|FakeOverride|() + R|/x|.R|FakeOverride|() } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/FieldSubstitution.txt b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/FieldSubstitution.txt index 8ee7b3356e1..16a7fa363df 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/FieldSubstitution.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/FieldSubstitution.txt @@ -5,7 +5,7 @@ FILE: Derived.kt } public final fun test(): R|kotlin/Unit| { - this@R|/Derived|.R|/JavaClass.myHost|.R|kotlin/String.length| + this@R|/Derived|.R|/Derived.myHost|.R|kotlin/String.length| } } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt index 998d56aeab7..1ffeda0ecba 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt @@ -6,8 +6,8 @@ FILE: K1.kt } public final fun main(k: R|KSub|, vString: R|SuperClass.NestedInSuperClass|, vInt: R|SuperClass.NestedInSuperClass|): R|kotlin/Unit| { - R|/k|.R|/J1.getImpl|().R|FakeOverride|(R|/vString|) - R|/k|.R|/J1.getImpl|().R|FakeOverride|(R|/vInt|) + R|/k|.R|/J1.getImpl|().R|FakeOverride|(R|/vString|) + R|/k|.R|/J1.getImpl|().R|FakeOverride|(R|/vInt|) R|/k|.R|/J1.getNestedSubClass|().#(String()) R|/k|.R|/J1.getNestedSubClass|().R|/SuperClass.NestedInSuperClass.nested|(Int(1)) } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKInheritanceGeneric.txt b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKInheritanceGeneric.txt index 3a228e140b8..e7f0f8b4c93 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKInheritanceGeneric.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/KJKInheritanceGeneric.txt @@ -16,7 +16,7 @@ FILE: K2.kt } public final fun bar(): R|kotlin/Unit| { - this@R|/K2|.R|FakeOverride!|>|(Int(1)) + this@R|/K2|.R|FakeOverride!|>|(Int(1)) this@R|/K2|.R|/J1.baz|() } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyIterable.txt b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyIterable.txt index dfe4107b431..ef15b928c1f 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyIterable.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyIterable.txt @@ -1,8 +1,8 @@ FILE: test.kt public abstract interface UseIterable : R|MyIterable| { public open fun test(): R|kotlin/Unit| { - lval it: R|kotlin/collections/MutableIterator!>| = this@R|/UseIterable|.R|FakeOverride!>|>|() - lval split: R|java/util/Spliterator!>| = this@R|/UseIterable|.R|FakeOverride!>|>|() + lval it: R|kotlin/collections/MutableIterator!>| = this@R|/UseIterable|.R|FakeOverride!>|>|() + lval split: R|java/util/Spliterator!>| = this@R|/UseIterable|.R|FakeOverride!>|>|() } } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyMap.txt b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyMap.txt index b77a2c43aa1..9013ae3931f 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyMap.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/j+k/MyMap.txt @@ -4,9 +4,9 @@ FILE: test.kt ^ String(value) } ) - lval otherResult: R|ft!| = R|/map|.R|FakeOverride!|>|(String(key), String(value)) - lval anotherResult: R|kotlin/String?| = R|/map|.R|FakeOverride|(String(key), String(value)) - R|/map|.R|FakeOverride|( = forEach@fun (key: R|ft!|, value: R|ft!|): R|kotlin/Unit| { + lval otherResult: R|ft!| = R|/map|.R|FakeOverride!|>|(String(key), String(value)) + lval anotherResult: R|kotlin/String?| = R|/map|.R|FakeOverride|(String(key), String(value)) + R|/map|.R|FakeOverride|( = forEach@fun (key: R|ft!|, value: R|ft!|): R|kotlin/Unit| { R|kotlin/io/println|((R|/key|.R|kotlin/Any.toString|(), String(: ), R|/value|.R|kotlin/Any.toString|())) R|/key|.R|kotlin/String.length| ^ R|/value|.R|kotlin/String.length| @@ -26,7 +26,7 @@ FILE: test.kt ^ String(value) } ) - lval otherResult: R|kotlin/String| = R|/map|.R|FakeOverride|(String(key), String(value)) + lval otherResult: R|kotlin/String| = R|/map|.R|FakeOverride|(String(key), String(value)) lval anotherResult: R|kotlin/String?| = R|/map|.R|FakeOverride|(String(key), String(value)) R|/map|.R|FakeOverride|( = forEach@fun (key: R|ft!|, value: R|ft!|): R|kotlin/Unit| { R|kotlin/io/println|((R|/key|.R|kotlin/Any.toString|(), String(: ), R|/value|.R|kotlin/Any.toString|())) diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/problems.txt b/compiler/fir/resolve/testData/resolveWithStdlib/problems.txt index 57acb464bee..d3d387ad5a3 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/problems.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/problems.txt @@ -53,7 +53,7 @@ FILE: problems.kt } } - public final val xx: R|kotlin/Int| = R|/Derived.Derived|().R|FakeOverride|.R|kotlin/Int.plus|(Int(1)) + public final val xx: R|kotlin/Int| = R|/Derived.Derived|().R|FakeOverride|.R|kotlin/Int.plus|(Int(1)) public get(): R|kotlin/Int| public final val t: R|kotlin/Nothing| = throw R|java/lang/AssertionError.AssertionError|(String()) public get(): R|kotlin/Nothing| diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/removeOnAbstractMap.txt b/compiler/fir/resolve/testData/resolveWithStdlib/removeOnAbstractMap.txt index e24e4aabaeb..07d7aa4ba2d 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/removeOnAbstractMap.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/removeOnAbstractMap.txt @@ -1,5 +1,5 @@ FILE: removeOnAbstractMap.kt public final fun test(map: R|java/util/AbstractMap|): R|kotlin/Unit| { - R|/map|.R|FakeOverride|(String(), Null(null)) + R|/map|.R|FakeOverride|(String(), Null(null)) R|/map|.R|FakeOverride|(Null(null)) } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/typeAliasDeserialization.txt b/compiler/fir/resolve/testData/resolveWithStdlib/typeAliasDeserialization.txt index ea126c1c809..898662073e3 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/typeAliasDeserialization.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/typeAliasDeserialization.txt @@ -1,5 +1,5 @@ FILE: typeAliasDeserialization.kt public final fun main(): R|kotlin/Unit| { lval a: R|java/util/LinkedHashSet| = R|java/util/LinkedHashSet.LinkedHashSet|() - R|/a|.R|FakeOverride|(String()) + R|/a|.R|FakeOverride|(String()) } diff --git a/compiler/fir/resolve/testData/resolveWithStdlib/typeParameterDerived.txt b/compiler/fir/resolve/testData/resolveWithStdlib/typeParameterDerived.txt index fbb94424f68..822451b2fb9 100644 --- a/compiler/fir/resolve/testData/resolveWithStdlib/typeParameterDerived.txt +++ b/compiler/fir/resolve/testData/resolveWithStdlib/typeParameterDerived.txt @@ -1,6 +1,6 @@ FILE: typeParameterDerived.kt public final inline fun R|kotlin/collections/MutableMap|.getOrPut(key: R|K|, defaultValue: R|(K) -> VA|, postCompute: R|(VA) -> kotlin/Unit|): R|V| { - lval value: R|V?| = this@R|/getOrPut|.R|FakeOverride|(R|/key|) + lval value: R|V?| = this@R|/getOrPut|.R|FakeOverride|(R|/key|) ^getOrPut when () { ==(R|/value|, Null(null)) -> { lval answer: R|VA| = R|/defaultValue|.R|FakeOverride|(R|/key|) diff --git a/compiler/testData/codegen/box/callableReference/function/booleanNotIntrinsic.kt b/compiler/testData/codegen/box/callableReference/function/booleanNotIntrinsic.kt index 547e00f6051..213c8d88996 100644 --- a/compiler/testData/codegen/box/callableReference/function/booleanNotIntrinsic.kt +++ b/compiler/testData/codegen/box/callableReference/function/booleanNotIntrinsic.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR fun box(): String { if ((Boolean::not)(true) != false) return "Fail 1" if ((Boolean::not)(false) != true) return "Fail 2" diff --git a/compiler/testData/codegen/box/callableReference/function/nestedConstructorFromClass.kt b/compiler/testData/codegen/box/callableReference/function/nestedConstructorFromClass.kt index 5ad978661e7..8e0439f4f03 100644 --- a/compiler/testData/codegen/box/callableReference/function/nestedConstructorFromClass.kt +++ b/compiler/testData/codegen/box/callableReference/function/nestedConstructorFromClass.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR class A { class Nested { val o = 111 diff --git a/compiler/testData/codegen/box/intrinsics/throwableCallableReference.kt b/compiler/testData/codegen/box/intrinsics/throwableCallableReference.kt index de38fb008db..5ef35aeae52 100644 --- a/compiler/testData/codegen/box/intrinsics/throwableCallableReference.kt +++ b/compiler/testData/codegen/box/intrinsics/throwableCallableReference.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS_IR // TODO: muted automatically, investigate should it be ran for JS or not // IGNORE_BACKEND: JS, NATIVE diff --git a/compiler/testData/ir/irText/expressions/kt30020.fir.txt b/compiler/testData/ir/irText/expressions/kt30020.fir.txt index 208d697844d..e61d34062e9 100644 --- a/compiler/testData/ir/irText/expressions/kt30020.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt30020.fir.txt @@ -175,22 +175,22 @@ FILE fqName: fileName:/kt30020.kt VALUE_PARAMETER name:toIndex index:1 type:kotlin.Int FUN FAKE_OVERRIDE name:contains visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Boolean [fake_override,operator] overridden: - public abstract fun contains (element: E of kotlin.collections.MutableList): kotlin.Boolean [operator] declared in kotlin.collections.List + public abstract fun contains (element: E of kotlin.collections.MutableList): kotlin.Boolean [operator] declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:element index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:containsAll visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, elements:kotlin.collections.Collection) returnType:kotlin.Boolean [fake_override] overridden: - public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.List + public abstract fun containsAll (elements: kotlin.collections.Collection): kotlin.Boolean declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:elements index:0 type:kotlin.collections.Collection FUN FAKE_OVERRIDE name:get visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, index:kotlin.Int) returnType:kotlin.Int [fake_override,operator] overridden: - public abstract fun get (index: kotlin.Int): E of kotlin.collections.MutableList [operator] declared in kotlin.collections.List + public abstract fun get (index: kotlin.Int): E of kotlin.collections.MutableList [operator] declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:index index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:indexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int [fake_override] overridden: - public abstract fun indexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.List + public abstract fun indexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:element index:0 type:kotlin.Int FUN FAKE_OVERRIDE name:isEmpty visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List) returnType:kotlin.Boolean [fake_override] @@ -199,11 +199,11 @@ FILE fqName: fileName:/kt30020.kt $this: VALUE_PARAMETER name: type:kotlin.collections.List FUN FAKE_OVERRIDE name:iterator visibility:public modality:ABSTRACT <> ($this:kotlin.collections.MutableCollection) returnType:kotlin.collections.MutableIterator [fake_override,operator] overridden: - public abstract fun iterator (): kotlin.collections.MutableIterator [operator] declared in kotlin.collections.MutableCollection + public abstract fun iterator (): kotlin.collections.MutableIterator [operator] declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.collections.MutableCollection FUN FAKE_OVERRIDE name:lastIndexOf visibility:public modality:ABSTRACT <> ($this:kotlin.collections.List, element:kotlin.Int) returnType:kotlin.Int [fake_override] overridden: - public abstract fun lastIndexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.List + public abstract fun lastIndexOf (element: E of kotlin.collections.MutableList): kotlin.Int declared in kotlin.collections.MutableList $this: VALUE_PARAMETER name: type:kotlin.collections.List VALUE_PARAMETER name:element index:0 type:kotlin.Int PROPERTY FAKE_OVERRIDE name:size visibility:public modality:ABSTRACT [fake_override,val] diff --git a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt index f639af5f070..2ebfda66fa0 100644 --- a/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt +++ b/compiler/testData/ir/irText/expressions/useImportedMember.fir.txt @@ -242,7 +242,7 @@ FILE fqName: fileName:/useImportedMember.kt BRANCH if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public open fun fromInterface (): T of .I.fromInterface declared in .I' type=kotlin.Int origin=null + arg0: CALL 'public open fun fromInterface (): T of .C.fromInterface declared in .C' type=kotlin.Int origin=null : kotlin.Int $this: CONST Int type=kotlin.Int value=9 $receiver: CONST Int type=kotlin.Int value=9 @@ -264,7 +264,8 @@ FILE fqName: fileName:/useImportedMember.kt BRANCH if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: CALL 'public open fun genericFromSuper (g: kotlin.String): kotlin.String declared in .I' type=kotlin.String origin=null + arg0: CALL 'public open fun genericFromSuper (g: kotlin.String): kotlin.String declared in .C' type=kotlin.String origin=null + $this: GET_OBJECT 'CLASS OBJECT name:C modality:FINAL visibility:public superTypes:[.BaseClass; .I]' type=.C g: CONST String type=kotlin.String value="11" arg1: CONST String type=kotlin.String value="11" then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in ' diff --git a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt index 0a0e0d7c4a2..d24487e7d94 100644 --- a/compiler/testData/ir/irText/stubs/builtinMap.fir.txt +++ b/compiler/testData/ir/irText/stubs/builtinMap.fir.txt @@ -27,7 +27,7 @@ FILE fqName: fileName:/builtinMap.kt $receiver: VALUE_PARAMETER name: type:java.util.LinkedHashMap.plus?, V1 of .plus?> BLOCK_BODY RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .plus' - CALL 'public open fun put (p0: K1 of .plus?, p1: V1 of .plus?): V1 of .plus? declared in java.util.HashMap' type=V1 of .plus? origin=null + CALL 'public open fun put (p0: K1 of .plus?, p1: V1 of .plus?): V1 of .plus? declared in java.util.LinkedHashMap' type=V1 of .plus? origin=null $this: GET_VAR ': java.util.LinkedHashMap.plus?, V1 of .plus?> declared in special.' type=java.util.LinkedHashMap.plus?, V1 of .plus?> origin=null p0: CALL 'public final fun (): K1 of .plus declared in kotlin.Pair' type=K1 of .plus origin=GET_PROPERTY $this: GET_VAR 'pair: kotlin.Pair.plus, V1 of .plus> declared in .plus' type=kotlin.Pair.plus, V1 of .plus> origin=null diff --git a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt index 1cb7e5a65dd..935a70b33a3 100644 --- a/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt +++ b/compiler/testData/ir/irText/stubs/genericClassInDifferentModule_m2.fir.txt @@ -15,7 +15,7 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt VALUE_PARAMETER name:y index:0 type:Y of .Derived1.foo BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun foo (y: Y of .Derived1.foo): T of .Derived1 declared in .Derived1' - CALL 'public final fun (): T of .Derived1 declared in .Base' type=T of .Derived1 origin=GET_PROPERTY + CALL 'public final fun (): T of .Derived1 declared in .Derived1' type=T of .Derived1 origin=GET_PROPERTY $this: GET_VAR ': .Derived1.Derived1> declared in .Derived1.foo' type=.Derived1.Derived1> origin=null PROPERTY name:bar visibility:public modality:FINAL [var] FIELD PROPERTY_BACKING_FIELD name:bar type:T of .Derived1 visibility:private @@ -44,7 +44,7 @@ FILE fqName: fileName:/genericClassInDifferentModule_m2.kt $receiver: VALUE_PARAMETER name: type:Z of .Derived1. BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun (): T of .Derived1 declared in .Derived1' - CALL 'public final fun (): T of .Derived1 declared in .Base' type=T of .Derived1 origin=GET_PROPERTY + CALL 'public final fun (): T of .Derived1 declared in .Derived1' type=T of .Derived1 origin=GET_PROPERTY $this: GET_VAR ': .Derived1.Derived1> declared in .Derived1.' type=.Derived1.Derived1> origin=null FUN name: visibility:public modality:FINAL ($this:.Derived1.Derived1>, $receiver:Z of .Derived1., value:T of .Derived1) returnType:kotlin.Unit correspondingProperty: PROPERTY name:exn visibility:public modality:FINAL [var] diff --git a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt index 1c737c94a5e..695ae2cc724 100644 --- a/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/enhancedNullabilityInForLoop.fir.txt @@ -6,27 +6,27 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP VAR FOR_LOOP_ITERATOR name:tmp_0 type:kotlin.collections.MutableIterator<.P?> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P?> origin=FOR_LOOP_ITERATOR + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<.P?> origin=FOR_LOOP_ITERATOR $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P?>? declared in .J' type=kotlin.collections.List<.P?>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P?> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P?> origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:x type:.P? [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=FOR_LOOP_NEXT + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.MutableIterator' type=.P? origin=FOR_LOOP_NEXT $this: GET_VAR 'val tmp_0: kotlin.collections.MutableIterator<.P?> [val] declared in .testForInListUnused' type=kotlin.collections.MutableIterator<.P?> origin=null FUN name:testForInListDestructured visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP VAR FOR_LOOP_ITERATOR name:tmp_1 type:kotlin.collections.MutableIterator<.P?> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P?> origin=FOR_LOOP_ITERATOR + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<.P?> origin=FOR_LOOP_ITERATOR $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P?>? declared in .J' type=kotlin.collections.List<.P?>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P?> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P?> origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name: type:.P? [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=FOR_LOOP_NEXT + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.MutableIterator' type=.P? origin=FOR_LOOP_NEXT $this: GET_VAR 'val tmp_1: kotlin.collections.MutableIterator<.P?> [val] declared in .testForInListDestructured' type=kotlin.collections.MutableIterator<.P?> origin=null VAR name:x type:kotlin.Int [val] CALL 'public final fun component1 (): kotlin.Int declared in .P' type=kotlin.Int origin=null @@ -37,14 +37,14 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt FUN name:testDesugaredForInList visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY VAR name:iterator type:kotlin.collections.MutableIterator<.P?> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P?> origin=null + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<.P?> origin=null $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P?>? declared in .J' type=kotlin.collections.List<.P?>? origin=null WHILE label=null origin=WHILE_LOOP condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=null $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<.P?> [val] declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<.P?> origin=null body: BLOCK type=kotlin.Unit origin=WHILE_LOOP VAR name:x type:.P? [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=null + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.MutableIterator' type=.P? origin=null $this: GET_VAR 'val iterator: kotlin.collections.MutableIterator<.P?> [val] declared in .testDesugaredForInList' type=kotlin.collections.MutableIterator<.P?> origin=null FUN name:testForInArrayUnused visibility:public modality:FINAL <> (j:.J) returnType:kotlin.Unit VALUE_PARAMETER name:j index:0 type:.J @@ -65,14 +65,14 @@ FILE fqName: fileName:/enhancedNullabilityInForLoop.kt BLOCK_BODY BLOCK type=kotlin.Unit origin=FOR_LOOP VAR FOR_LOOP_ITERATOR name:tmp_3 type:kotlin.collections.MutableIterator<.P?> [val] - CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableCollection' type=kotlin.collections.MutableIterator<.P?> origin=FOR_LOOP_ITERATOR + CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<.P?> [operator] declared in kotlin.collections.MutableList' type=kotlin.collections.MutableIterator<.P?> origin=FOR_LOOP_ITERATOR $this: CALL 'public open fun listOfNotNull (): kotlin.collections.List<.P?>? declared in .J' type=kotlin.collections.List<.P?>? origin=null WHILE label=null origin=FOR_LOOP_INNER_WHILE condition: CALL 'public abstract fun hasNext (): kotlin.Boolean [operator] declared in kotlin.collections.Iterator' type=kotlin.Boolean origin=FOR_LOOP_HAS_NEXT $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P?> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P?> origin=null body: BLOCK type=kotlin.Unit origin=FOR_LOOP_INNER_WHILE VAR FOR_LOOP_VARIABLE name:x type:.P? [val] - CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.Iterator' type=.P? origin=FOR_LOOP_NEXT + CALL 'public abstract fun next (): T of kotlin.collections.MutableIterator [operator] declared in kotlin.collections.MutableIterator' type=.P? origin=FOR_LOOP_NEXT $this: GET_VAR 'val tmp_3: kotlin.collections.MutableIterator<.P?> [val] declared in .testForInListUse' type=kotlin.collections.MutableIterator<.P?> origin=null CALL 'public final fun use (s: .P): kotlin.Unit declared in ' type=kotlin.Unit origin=null s: GET_VAR 'val x: .P? [val] declared in .testForInListUse' type=.P? origin=null