diff --git a/compiler/fir/analysis-tests/testData/resolve/delegatedSuperType.fir.txt b/compiler/fir/analysis-tests/testData/resolve/delegatedSuperType.fir.txt index 750ae3ad097..378559e64e7 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegatedSuperType.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/delegatedSuperType.fir.txt @@ -17,7 +17,7 @@ FILE: delegatedSuperType.kt super() } - local final field <$$delegate_0>: R|A| = R|/b| + private final field $$delegate_0: R|A| = R|/b| public final val b: R|B| = R|/b| public get(): R|B| diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/anonymousObjectByDelegate.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/anonymousObjectByDelegate.fir.txt index cc3f18011e9..099afee2b9e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/anonymousObjectByDelegate.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/anonymousObjectByDelegate.fir.txt @@ -13,7 +13,7 @@ FILE: anonymousObjectByDelegate.kt super() } - local final field <$$delegate_0>: R|B| = this@R|/test_1|.R|/A.b| + private final field $$delegate_0: R|B| = this@R|/test_1|.R|/A.b| } @@ -24,7 +24,7 @@ FILE: anonymousObjectByDelegate.kt super() } - local final field <$$delegate_0>: R|B| = this@R|/test_2|.R|/A.b| + private final field $$delegate_0: R|B| = this@R|/test_2|.R|/A.b| } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt index a00290c6504..cc72b689b40 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/delegationInInterface.fir.txt @@ -6,7 +6,7 @@ FILE: delegationInInterface.kt } public abstract interface B : R|A| { - local final field <$$delegate_0>: R|A| = # + private final field $$delegate_0: R|A| = # public abstract val a: R|A| public get(): R|A| @@ -15,6 +15,6 @@ FILE: delegationInInterface.kt public final val test: R|A| = R|/A.A|() public get(): R|A| public abstract interface C : R|A| { - local final field <$$delegate_0>: R|A| = R|/test| + private final field $$delegate_0: R|A| = R|/test| } diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.fir.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.fir.txt index c761b0afb53..a8062940668 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/superCallWithDelegation.fir.txt @@ -8,7 +8,7 @@ FILE: superCallWithDelegation.kt super() } - local final field <$$delegate_0>: R|A| = R|/a| + private final field $$delegate_0: R|A| = R|/a| private final val a: R|A| = R|/a| private get(): R|A| diff --git a/compiler/fir/analysis-tests/testData/resolve/inlineClasses/inlineClassDeclaration.fir.txt b/compiler/fir/analysis-tests/testData/resolve/inlineClasses/inlineClassDeclaration.fir.txt index 59e4dc918cc..93c35022616 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inlineClasses/inlineClassDeclaration.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/inlineClasses/inlineClassDeclaration.fir.txt @@ -103,7 +103,7 @@ FILE: inlineClassDeclaration.kt super() } - local final field <$$delegate_0>: R|kotlin/Comparable| = R|/x| + private final field $$delegate_0: R|kotlin/Comparable| = R|/x| public final val x: R|kotlin/Int| = R|/x| public get(): R|kotlin/Int| diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot index 4edec316742..4176fbc4f0e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.dot @@ -121,7 +121,7 @@ digraph smartcastInByClause_kt { super() } - local final field <$$delegate_0>: R|Base| = R|/Derived.Derived|(R|/a|.R|/A.index|) + private final field $$delegate_0: R|Base| = R|/Derived.Derived|(R|/a|.R|/A.index|) public final val x: R|kotlin/Int| = R|/a|.R|/A.index| public get(): R|kotlin/Int| diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.fir.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.fir.txt index 7c4d0f5d0aa..50f38e41706 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/smartcastInByClause.fir.txt @@ -30,7 +30,7 @@ FILE: smartcastInByClause.kt super() } - local final field <$$delegate_0>: R|Base| = R|/Derived.Derived|(R|/a|.R|/A.index|) + private final field $$delegate_0: R|Base| = R|/Derived.Derived|(R|/a|.R|/A.index|) public final val x: R|kotlin/Int| = R|/a|.R|/A.index| public get(): R|kotlin/Int| diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/AbstractToolConfig.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/AbstractToolConfig.fir.txt index ce38796e17f..04ead6b1663 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/AbstractToolConfig.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/problems/AbstractToolConfig.fir.txt @@ -28,7 +28,7 @@ FILE: Platform.kt super() } - local final field <$$delegate_0>: R|Configurables| = R|/configurables| + private final field $$delegate_0: R|Configurables| = R|/configurables| public final val configurables: R|Configurables| = R|/configurables| public get(): R|Configurables| diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt index 030e81d009f..034281f062f 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/FirHelpers.kt @@ -423,7 +423,7 @@ private val FirNamedFunctionSymbol.matchesHashCodeSignature: Boolean private val FirNamedFunctionSymbol.matchesToStringSignature: Boolean get() = valueParameterSymbols.isEmpty() -val Name.isDelegated: Boolean get() = asString().startsWith("<\$\$delegate_") +val Name.isDelegated: Boolean get() = asString().startsWith("\$\$delegate_") val ConeTypeProjection.isConflictingOrNotInvariant: Boolean get() = kind != ProjectionKind.INVARIANT || this is ConeKotlinTypeConflictingProjection diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt index 08e6cf9a78b..d9f908bc9ab 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirSupertypesChecker.kt @@ -169,10 +169,7 @@ object FirSupertypesChecker : FirClassChecker() { ) { for (subDeclaration in declaration.declarations) { if (subDeclaration is FirField) { - if (subDeclaration.visibility == Visibilities.Local && - subDeclaration.name.isSpecial && - subDeclaration.name.isDelegated - ) { + if (subDeclaration.visibility == Visibilities.Private && subDeclaration.name.isDelegated) { val delegatedClassSymbol = subDeclaration.returnTypeRef.toRegularClassSymbol(context.session) if (delegatedClassSymbol != null && delegatedClassSymbol.classKind != ClassKind.INTERFACE) { reporter.reportOn(subDeclaration.returnTypeRef.source, FirErrors.DELEGATION_NOT_TO_INTERFACE, context) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt index ccbcab73f84..b32c1ae43b0 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrConverter.kt @@ -42,6 +42,7 @@ import org.jetbrains.kotlin.ir.interpreter.checker.IrConstTransformer import org.jetbrains.kotlin.ir.util.* import org.jetbrains.kotlin.ir.visitors.acceptVoid import org.jetbrains.kotlin.psi.KtFile +import org.jetbrains.kotlin.utils.addIfNotNull class Fir2IrConverter( private val moduleDescriptor: FirModuleDescriptor, @@ -182,8 +183,7 @@ class Fir2IrConverter( private fun processFileAndClassMembers(file: FirFile) { val irFile = declarationStorage.getIrFile(file) for (declaration in file.declarations) { - val irDeclaration = processMemberDeclaration(declaration, null, irFile) ?: continue - irFile.declarations += irDeclaration + processMemberDeclaration(declaration, null, irFile) } } @@ -202,8 +202,7 @@ class Fir2IrConverter( ) } for (declaration in syntheticPropertiesLast(anonymousObject.declarations)) { - val irDeclaration = processMemberDeclaration(declaration, anonymousObject, irClass) ?: continue - irClass.declarations += irDeclaration + processMemberDeclaration(declaration, anonymousObject, irClass) } // Add delegated members *before* fake override generations. // Otherwise, fake overrides for delegated members, which are redundant, will be added. @@ -235,8 +234,7 @@ class Fir2IrConverter( } // At least on enum entry creation we may need a default constructor, so ctors should be converted first for (declaration in syntheticPropertiesLast(allDeclarations)) { - val irDeclaration = processMemberDeclaration(declaration, regularClass, irClass) ?: continue - irClass.declarations += irDeclaration + processMemberDeclaration(declaration, regularClass, irClass) } // Add delegated members *before* fake override generations. // Otherwise, fake overrides for delegated members, which are redundant, will be added. @@ -344,63 +342,60 @@ class Fir2IrConverter( } } + // Process `declaration` and add the results to `parent`. private fun processMemberDeclaration( declaration: FirDeclaration, containingClass: FirClass?, - parent: IrDeclarationParent - ): IrDeclaration? { + parent: IrDeclarationContainer + ) { val isLocal = containingClass != null && (containingClass !is FirRegularClass || containingClass.isLocal) - return when (declaration) { + when (declaration) { is FirRegularClass -> { - processClassMembers(declaration) + parent.declarations += processClassMembers(declaration) } is FirScript -> { assert(parent is IrFile) declarationStorage.getOrCreateIrScript(declaration) } is FirSimpleFunction -> { - declarationStorage.getOrCreateIrFunction( + parent.declarations += declarationStorage.getOrCreateIrFunction( declaration, parent, isLocal = isLocal ) } is FirProperty -> { - if (declaration.source?.kind == KtFakeSourceElementKind.EnumGeneratedDeclaration && - declaration.name == StandardNames.ENUM_ENTRIES && - !session.languageVersionSettings.supportsFeature(LanguageFeature.EnumEntries) + if (declaration.source?.kind != KtFakeSourceElementKind.EnumGeneratedDeclaration || + declaration.name != StandardNames.ENUM_ENTRIES || + session.languageVersionSettings.supportsFeature(LanguageFeature.EnumEntries) ) { - // Note: we have to do it, because backend without the feature - // cannot process Enum.entries properly - null - } else { - declarationStorage.getOrCreateIrProperty( + parent.declarations += declarationStorage.getOrCreateIrProperty( declaration, parent, isLocal = isLocal ) } } is FirField -> { - if (declaration.isSynthetic) { + require(declaration.isSynthetic) { + "Unexpected non-synthetic field: ${declaration::class}" + } + parent.declarations.addIfNotNull( declarationStorage.createIrFieldAndDelegatedMembers(declaration, containingClass!!, parent as IrClass) - } else { - throw AssertionError("Unexpected non-synthetic field: ${declaration::class}") + ) + } + is FirConstructor -> { + if (!declaration.isPrimary) { + parent.declarations += declarationStorage.getOrCreateIrConstructor( + declaration, parent as IrClass, isLocal = isLocal + ) } } - is FirConstructor -> if (!declaration.isPrimary) { - declarationStorage.getOrCreateIrConstructor( - declaration, parent as IrClass, isLocal = isLocal - ) - } else { - null - } is FirEnumEntry -> { - classifierStorage.createIrEnumEntry(declaration, parent as IrClass) + parent.declarations += classifierStorage.createIrEnumEntry(declaration, parent as IrClass) } is FirAnonymousInitializer -> { - declarationStorage.createIrAnonymousInitializer(declaration, parent as IrClass) + parent.declarations += declarationStorage.createIrAnonymousInitializer(declaration, parent as IrClass) } is FirTypeAlias -> { // DO NOTHING - null } else -> { error("Unexpected member: ${declaration::class}") 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 3c321aeb2fb..ddae7d41f8f 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 @@ -897,7 +897,7 @@ class Fir2IrDeclarationStorage( createBackingField( property, IrDeclarationOrigin.PROPERTY_DELEGATE, components.visibilityConverter.convertToDescriptorVisibility(property.fieldVisibility), - Name.identifier("${property.name}\$delegate"), true, delegate + SpecialNames.propertyDelegateName(property.name), true, delegate ) } else { val initializer = property.backingField?.initializer ?: property.initializer @@ -1230,7 +1230,7 @@ class Fir2IrDeclarationStorage( enterScope(this) delegate = declareIrVariable( startOffset, endOffset, IrDeclarationOrigin.PROPERTY_DELEGATE, - Name.identifier("${property.name}\$delegate"), property.delegate!!.typeRef.toIrType(), + SpecialNames.propertyDelegateName(property.name), property.delegate!!.typeRef.toIrType(), isVar = false, isConst = false, isLateinit = false ) delegate.parent = irParent diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt index e693481c429..c1a7bcbe256 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/lazy/Fir2IrLazyProperty.kt @@ -33,6 +33,7 @@ import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.ir.expressions.IrExpressionBody import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol import org.jetbrains.kotlin.ir.util.isComposite +import org.jetbrains.kotlin.name.SpecialNames class Fir2IrLazyProperty( components: Fir2IrComponents, @@ -146,7 +147,7 @@ class Fir2IrLazyProperty( createBackingField( fir, IrDeclarationOrigin.PROPERTY_DELEGATE, components.visibilityConverter.convertToDescriptorVisibility(fir.visibility), - Name.identifier("${fir.name}\$delegate"), true, fir.delegate + SpecialNames.propertyDelegateName(fir.name), true, fir.delegate ) } } diff --git a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt index 0e820ed8536..49a4908da27 100644 --- a/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt +++ b/compiler/fir/raw-fir/light-tree2fir/src/org/jetbrains/kotlin/fir/lightTree/converter/DeclarationsConverter.kt @@ -51,7 +51,6 @@ import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.builder.* import org.jetbrains.kotlin.fir.types.impl.* import org.jetbrains.kotlin.lexer.KtModifierKeywordToken -import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.lexer.KtTokens.* import org.jetbrains.kotlin.name.* import org.jetbrains.kotlin.utils.addToStdlib.runIf @@ -1848,18 +1847,17 @@ class DeclarationsConverter( explicitDelegation.toFirSourceElement(), ConeSimpleDiagnostic("Should have delegate", DiagnosticKind.Syntax) ) - val delegateName = Name.special("<\$\$delegate_${delegateFieldsMap.size}>") delegateFieldsMap.put( index, buildField { source = calculatedFirExpression.source?.fakeElement(KtFakeSourceElementKind.ClassDelegationField) moduleData = baseModuleData origin = FirDeclarationOrigin.Synthetic - name = delegateName + name = SpecialNames.delegateFieldName(delegateFieldsMap.size) returnTypeRef = firTypeRef symbol = FirFieldSymbol(CallableId(name)) isVar = false - status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL) + status = FirDeclarationStatusImpl(Visibilities.Private, Modality.FINAL) initializer = calculatedFirExpression }.symbol ) @@ -2019,7 +2017,7 @@ class DeclarationsConverter( private fun convertIntersectionType(typeRefSource: KtSourceElement, intersectionType: LighterASTNode, isNullable: Boolean): FirTypeRef { val children = arrayListOf() intersectionType.forEachChildren { - if (it.tokenType != KtTokens.AND) { //skip in forEachChildren? + if (it.tokenType != AND) { //skip in forEachChildren? children.add(convertType(it)) } } diff --git a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt index 58ee64bedd0..cc155d5eae4 100644 --- a/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt +++ b/compiler/fir/raw-fir/psi2fir/src/org/jetbrains/kotlin/fir/builder/RawFirBuilder.kt @@ -382,7 +382,7 @@ open class RawFirBuilder( private fun ValueArgument?.toFirExpression(): FirExpression { if (this == null) { return buildErrorExpression( - (this as? KtElement)?.toFirSourceElement(), + source = null, ConeSimpleDiagnostic("No argument given", DiagnosticKind.Syntax), ) } @@ -848,18 +848,17 @@ open class RawFirBuilder( val type = superTypeListEntry.typeReference.toFirOrErrorType() val delegateExpression = { superTypeListEntry.delegateExpression }.toFirExpression("Should have delegate") container.superTypeRefs += type - val delegateName = Name.special("<\$\$delegate_${delegateFieldsMap.size}>") val delegateSource = superTypeListEntry.delegateExpression?.toFirSourceElement(KtFakeSourceElementKind.ClassDelegationField) val delegateField = buildField { source = delegateSource moduleData = baseModuleData origin = FirDeclarationOrigin.Synthetic - name = delegateName + name = SpecialNames.delegateFieldName(delegateFieldsMap.size) returnTypeRef = type symbol = FirFieldSymbol(CallableId(name)) isVar = false - status = FirDeclarationStatusImpl(Visibilities.Local, Modality.FINAL) + status = FirDeclarationStatusImpl(Visibilities.Private, Modality.FINAL) initializer = delegateExpression } delegateFieldsMap[index] = delegateField.symbol diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrDelegateDescriptor.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrDelegateDescriptor.kt index a2dd85e99fb..4096b244545 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrDelegateDescriptor.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/descriptors/IrDelegateDescriptor.kt @@ -21,6 +21,7 @@ import org.jetbrains.kotlin.descriptors.annotations.Annotations import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl import org.jetbrains.kotlin.descriptors.impl.VariableDescriptorImpl import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.name.SpecialNames import org.jetbrains.kotlin.resolve.constants.ConstantValue import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeSubstitutor @@ -97,7 +98,7 @@ class IrPropertyDelegateDescriptorImpl( ) : IrDelegateDescriptorBase( correspondingProperty.containingDeclaration, - getDelegateName(correspondingProperty.name), + SpecialNames.propertyDelegateName(correspondingProperty.name), delegateType, correspondingProperty.delegateField?.annotations ?: Annotations.EMPTY ), @@ -111,14 +112,11 @@ class IrImplementingDelegateDescriptorImpl( ) : IrDelegateDescriptorBase( containingDeclaration, - Name.identifier("\$\$delegate_$number"), + SpecialNames.delegateFieldName(number), delegateType ), IrImplementingDelegateDescriptor -internal fun getDelegateName(name: Name): Name = - Name.identifier(name.asString() + "\$delegate") - class IrLocalDelegatedPropertyDelegateDescriptorImpl( override val correspondingLocalProperty: VariableDescriptorWithAccessors, delegateType: KotlinType, @@ -127,16 +125,16 @@ class IrLocalDelegatedPropertyDelegateDescriptorImpl( VariableDescriptorImpl( correspondingLocalProperty.containingDeclaration, Annotations.EMPTY, - getDelegateName(correspondingLocalProperty.name), + SpecialNames.propertyDelegateName(correspondingLocalProperty.name), delegateType, - org.jetbrains.kotlin.descriptors.SourceElement.NO_SOURCE + SourceElement.NO_SOURCE ) { override fun getCompileTimeInitializer(): ConstantValue<*>? = null override fun cleanCompileTimeInitializerCache() {} override fun isVar(): Boolean = false override fun isLateInit(): Boolean = false - override fun substitute(substitutor: TypeSubstitutor): VariableDescriptor? = throw UnsupportedOperationException() + override fun substitute(substitutor: TypeSubstitutor): VariableDescriptor = throw UnsupportedOperationException() override fun getVisibility(): DescriptorVisibility = DescriptorVisibilities.LOCAL override fun accept(visitor: DeclarationDescriptorVisitor, data: D): R = diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt index 2bce7c20e8f..08435d86f20 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt @@ -56,7 +56,7 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt BLOCK_BODY CALL 'public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : B of .Test1.foo - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null 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 @@ -74,7 +74,7 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt RETURN type=kotlin.Nothing from='public open fun (): kotlin.collections.Map.Test1, C of .Test1.>? declared in .Test1' CALL 'public abstract fun (): kotlin.collections.Map.IBase, C of .IBase.>? declared in .IBase' type=kotlin.collections.Map.Test1, C of .Test1.>? origin=null : C of .Test1. - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null $receiver: GET_VAR ': C of .Test1. declared in .Test1.' type=C of .Test1. origin=null PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [var] @@ -91,7 +91,7 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt RETURN type=kotlin.Nothing from='public open fun (): D of .Test1.? declared in .Test1' CALL 'public abstract fun (): D of .IBase.? declared in .IBase' type=D of .Test1.? origin=null : D of .Test1. - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null $receiver: GET_VAR ': kotlin.collections.List.Test1.> declared in .Test1.' type=kotlin.collections.List.Test1.> origin=null FUN DELEGATED_MEMBER name: visibility:public modality:OPEN ($this:.Test1.Test1>, $receiver:kotlin.collections.List.Test1.>, :D of .Test1.?) returnType:kotlin.Unit @@ -105,11 +105,11 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt BLOCK_BODY CALL 'public abstract fun (: D of .IBase.?): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : D of .Test1. - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test1> visibility:local [final]' type=.IBase.Test1> origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final]' type=.IBase.Test1> origin=null receiver: GET_VAR ': .Test1.Test1> declared in .Test1.' type=.Test1.Test1> origin=null $receiver: GET_VAR ': kotlin.collections.List.Test1.> declared in .Test1.' type=kotlin.collections.List.Test1.> origin=null : 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] + FIELD DELEGATE name:$$delegate_0 type:.IBase.Test1> visibility:private [final] EXPRESSION_BODY GET_VAR 'i: .IBase.Test1> declared in .Test1.' type=.IBase.Test1> origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt index 89c5a4c5217..e201e39c537 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt @@ -17,23 +17,23 @@ class Test1 : IBase { } override fun foo(a: E, b: B) { - .#<$$delegate_0>.foo(a = a, b = b) + .#$$delegate_0.foo(a = a, b = b) } override val C.id: Map? override get(): Map? { - return (.#<$$delegate_0>, ).() + return (.#$$delegate_0, ).() } override var List.x: D? override get(): D? { - return (.#<$$delegate_0>, ).() + return (.#$$delegate_0, ).() } override set(: D?) { - (.#<$$delegate_0>, ).( = ) + (.#$$delegate_0, ).( = ) } - local /* final field */ val <$$delegate_0>: IBase = i + private /* final field */ val $$delegate_0: IBase = i } diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt index 95677b0958d..09c68809428 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt @@ -216,7 +216,7 @@ FILE fqName: fileName:/delegatedImplementation.kt VALUE_PARAMETER name:s index:1 type:kotlin.String BLOCK_BODY CALL 'public final fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final]' type=.BaseImpl origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null receiver: GET_VAR ': .Test1 declared in .Test1.foo' type=.Test1 origin=null x: GET_VAR 'x: kotlin.Int declared in .Test1.foo' type=kotlin.Int origin=null s: GET_VAR 's: kotlin.String declared in .Test1.foo' type=kotlin.String origin=null @@ -227,7 +227,7 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .Test1' CALL 'public final fun bar (): kotlin.Int declared in .BaseImpl' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final]' type=.BaseImpl origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null receiver: GET_VAR ': .Test1 declared in .Test1.bar' type=.Test1 origin=null FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:.Test1, $receiver:kotlin.String) returnType:kotlin.Unit overridden: @@ -236,10 +236,10 @@ FILE fqName: fileName:/delegatedImplementation.kt $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY CALL 'public final fun qux (): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final]' type=.BaseImpl origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null receiver: GET_VAR ': .Test1 declared in .Test1.qux' type=.Test1 origin=null $receiver: GET_VAR ': kotlin.String declared in .Test1.qux' type=kotlin.String origin=null - FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] EXPRESSION_BODY GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -269,7 +269,7 @@ FILE fqName: fileName:/delegatedImplementation.kt VALUE_PARAMETER name:s index:1 type:kotlin.String BLOCK_BODY CALL 'public final fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final]' type=.BaseImpl origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null receiver: GET_VAR ': .Test2 declared in .Test2.foo' type=.Test2 origin=null x: GET_VAR 'x: kotlin.Int declared in .Test2.foo' type=kotlin.Int origin=null s: GET_VAR 's: kotlin.String declared in .Test2.foo' type=kotlin.String origin=null @@ -280,7 +280,7 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun bar (): kotlin.Int declared in .Test2' CALL 'public final fun bar (): kotlin.Int declared in .BaseImpl' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final]' type=.BaseImpl origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl origin=null receiver: GET_VAR ': .Test2 declared in .Test2.bar' type=.Test2 origin=null FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN <> ($this:.Test2, $receiver:kotlin.String) returnType:kotlin.Unit overridden: @@ -289,10 +289,10 @@ FILE fqName: fileName:/delegatedImplementation.kt $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY CALL 'public final fun qux (): kotlin.Unit declared in .BaseImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final]' type=.BaseImpl origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final]' type=.BaseImpl 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 - FIELD DELEGATE name:<$$delegate_0> type:.BaseImpl visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.BaseImpl visibility:private [final] EXPRESSION_BODY GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val] @@ -306,7 +306,7 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Test2' CALL 'public abstract fun (): kotlin.String declared in .IOther' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var] overridden: @@ -319,7 +319,7 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2, :kotlin.Int) returnType:kotlin.Unit correspondingProperty: PROPERTY DELEGATED_MEMBER name:y visibility:public modality:OPEN [var] @@ -329,7 +329,7 @@ FILE fqName: fileName:/delegatedImplementation.kt VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null : GET_VAR ': kotlin.Int declared in .Test2.' type=kotlin.Int origin=null PROPERTY DELEGATED_MEMBER name:z1 visibility:public modality:OPEN [val] @@ -344,7 +344,7 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.Byte declared in .Test2.' type=kotlin.Byte origin=null PROPERTY DELEGATED_MEMBER name:z2 visibility:public modality:OPEN [var] @@ -359,7 +359,7 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test2' CALL 'public abstract fun (): kotlin.Int declared in .IOther' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.Byte declared in .Test2.' type=kotlin.Byte origin=null FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Test2, $receiver:kotlin.Byte, :kotlin.Int) returnType:kotlin.Unit @@ -371,11 +371,11 @@ FILE fqName: fileName:/delegatedImplementation.kt VALUE_PARAMETER name: index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun (: kotlin.Int): kotlin.Unit declared in .IOther' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.IOther visibility:local [final]' type=.IOther origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final]' type=.IOther origin=null receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null $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] + FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final] EXPRESSION_BODY CALL 'public final fun otherImpl (x0: kotlin.String, y0: kotlin.Int): .IOther declared in ' type=.IOther origin=null x0: CONST String type=kotlin.String value="" diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt index 681da688bc7..42ca34226c5 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt @@ -85,18 +85,18 @@ class Test1 : IBase { } override fun foo(x: Int, s: String) { - .#<$$delegate_0>.foo(x = x, s = s) + .#$$delegate_0.foo(x = x, s = s) } override fun bar(): Int { - return .#<$$delegate_0>.bar() + return .#$$delegate_0.bar() } override fun String.qux() { - (.#<$$delegate_0>, ).qux() + (.#$$delegate_0, ).qux() } - local /* final field */ val <$$delegate_0>: BaseImpl = BaseImpl + private /* final field */ val $$delegate_0: BaseImpl = BaseImpl } @@ -108,44 +108,44 @@ class Test2 : IBase, IOther { } override fun foo(x: Int, s: String) { - .#<$$delegate_0>.foo(x = x, s = s) + .#$$delegate_0.foo(x = x, s = s) } override fun bar(): Int { - return .#<$$delegate_0>.bar() + return .#$$delegate_0.bar() } override fun String.qux() { - (.#<$$delegate_0>, ).qux() + (.#$$delegate_0, ).qux() } - local /* final field */ val <$$delegate_0>: BaseImpl = BaseImpl + private /* final field */ val $$delegate_0: BaseImpl = BaseImpl override val x: String override get(): String { - return .#<$$delegate_1>.() + return .#$$delegate_1.() } override var y: Int override get(): Int { - return .#<$$delegate_1>.() + return .#$$delegate_1.() } override set(: Int) { - .#<$$delegate_1>.( = ) + .#$$delegate_1.( = ) } override val Byte.z1: Int override get(): Int { - return (.#<$$delegate_1>, ).() + return (.#$$delegate_1, ).() } override var Byte.z2: Int override get(): Int { - return (.#<$$delegate_1>, ).() + return (.#$$delegate_1, ).() } override set(: Int) { - (.#<$$delegate_1>, ).( = ) + (.#$$delegate_1, ).( = ) } - local /* final field */ val <$$delegate_1>: IOther = otherImpl(x0 = "", y0 = 42) + private /* final field */ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42) } diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt index e645ea72c6e..bfb99e15476 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt @@ -59,9 +59,9 @@ FILE fqName: fileName:/delegatedImplementationWithExplicitOverride.kt $this: VALUE_PARAMETER name: type:.C BLOCK_BODY CALL 'public final fun foo (): kotlin.Unit declared in .FooBarImpl' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.FooBarImpl visibility:local [final]' type=.FooBarImpl origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.FooBarImpl visibility:private [final]' type=.FooBarImpl origin=null receiver: GET_VAR ': .C declared in .C.foo' type=.C origin=null - FIELD DELEGATE name:<$$delegate_0> type:.FooBarImpl visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.FooBarImpl visibility:private [final] EXPRESSION_BODY GET_OBJECT 'CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar]' type=.FooBarImpl FUN name:bar visibility:public modality:FINAL <> ($this:.C) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt index bccfcaf4698..6c124d522b1 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt @@ -27,11 +27,12 @@ class C : IFooBar { } override fun foo() { - .#<$$delegate_0>.foo() + .#$$delegate_0.foo() } - local /* final field */ val <$$delegate_0>: FooBarImpl = FooBarImpl + private /* final field */ val $$delegate_0: FooBarImpl = FooBarImpl override fun bar() { } } + diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt index a7c12f0dd1a..9b2f93b4e8c 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt @@ -139,9 +139,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestJFoo' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JFoo visibility:local [final]' type=.JFoo origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JFoo visibility:private [final]' type=.JFoo origin=null receiver: GET_VAR ': .TestJFoo declared in .TestJFoo.foo' type=.TestJFoo origin=null - FIELD DELEGATE name:<$$delegate_0> type:.JFoo visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.JFoo visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () [primary] declared in .JFoo' type=.JFoo origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -171,9 +171,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK1' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String [fake_override] declared in .K1' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.K1 visibility:local [final]' type=.K1 origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.K1 visibility:private [final]' type=.K1 origin=null receiver: GET_VAR ': .TestK1 declared in .TestK1.foo' type=.TestK1 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.K1 visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.K1 visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K1' type=.K1 origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -202,9 +202,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK2' CALL 'public final fun foo (): kotlin.String declared in .K2' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.K2 visibility:local [final]' type=.K2 origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.K2 visibility:private [final]' type=.K2 origin=null receiver: GET_VAR ': .TestK2 declared in .TestK2.foo' type=.TestK2 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.K2 visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.K2 visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K2' type=.K2 origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -233,9 +233,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK3' CALL 'public open fun foo (): kotlin.String [fake_override] declared in .K3' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.K3 visibility:local [final]' type=.K3 origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.K3 visibility:private [final]' type=.K3 origin=null receiver: GET_VAR ': .TestK3 declared in .TestK3.foo' type=.TestK3 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.K3 visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.K3 visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K3' type=.K3 origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] @@ -265,9 +265,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .TestK4' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public final fun foo (): @[FlexibleNullability] kotlin.String? declared in .K4' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.K4 visibility:local [final]' type=.K4 origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.K4 visibility:private [final]' type=.K4 origin=null receiver: GET_VAR ': .TestK4 declared in .TestK4.foo' type=.TestK4 origin=null - FIELD DELEGATE name:<$$delegate_0> type:.K4 visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.K4 visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () [primary] declared in .K4' type=.K4 origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt index 726bff4539a..335c9527e7c 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt @@ -55,10 +55,10 @@ class TestJFoo : IFoo { } override fun foo(): String { - return .#<$$delegate_0>.foo() /*!! String */ + return .#$$delegate_0.foo() /*!! String */ } - local /* final field */ val <$$delegate_0>: JFoo = JFoo() + private /* final field */ val $$delegate_0: JFoo = JFoo() } @@ -70,10 +70,10 @@ class TestK1 : IFoo { } override fun foo(): String { - return .#<$$delegate_0>.foo() /*!! String */ + return .#$$delegate_0.foo() /*!! String */ } - local /* final field */ val <$$delegate_0>: K1 = K1() + private /* final field */ val $$delegate_0: K1 = K1() } @@ -85,10 +85,10 @@ class TestK2 : IFoo { } override fun foo(): String { - return .#<$$delegate_0>.foo() + return .#$$delegate_0.foo() } - local /* final field */ val <$$delegate_0>: K2 = K2() + private /* final field */ val $$delegate_0: K2 = K2() } @@ -100,10 +100,10 @@ class TestK3 : IFoo { } override fun foo(): String { - return .#<$$delegate_0>.foo() + return .#$$delegate_0.foo() } - local /* final field */ val <$$delegate_0>: K3 = K3() + private /* final field */ val $$delegate_0: K3 = K3() } @@ -115,10 +115,10 @@ class TestK4 : IFoo { } override fun foo(): String { - return .#<$$delegate_0>.foo() /*!! String */ + return .#$$delegate_0.foo() /*!! String */ } - local /* final field */ val <$$delegate_0>: K4 = K4() + private /* final field */ val $$delegate_0: K4 = K4() } diff --git a/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt b/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt index 5d737dda6fe..895a53a5e0a 100644 --- a/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt @@ -14,9 +14,9 @@ FILE fqName: fileName:/kt45934.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.collections.MutableList<@[FlexibleNullability] C of .C.foo?>? declared in .C' CALL 'public open fun foo (): @[FlexibleNullability] kotlin.collections.MutableList<@[FlexibleNullability] kotlin.String?>? declared in .J' type=@[FlexibleNullability] kotlin.collections.MutableList<@[FlexibleNullability] C of .C.foo?>? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .C declared in .C.foo' type=.C origin=null - FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] EXPRESSION_BODY GET_VAR 'client: .J declared in .C.' type=.J origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt index 39b438b0aaa..18ed6ee567f 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt @@ -70,7 +70,7 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt $this: VALUE_PARAMETER name: type:.DFoo BLOCK_BODY CALL 'public abstract fun testFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .DFoo declared in .DFoo.testFun' type=.DFoo origin=null FUN DELEGATED_MEMBER name:testExtFun visibility:public modality:OPEN <> ($this:.DFoo, $receiver:kotlin.String) returnType:kotlin.Unit annotations: @@ -81,7 +81,7 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt $receiver: VALUE_PARAMETER name: type:kotlin.String BLOCK_BODY CALL 'public abstract fun testExtFun (): kotlin.Unit declared in .IFoo' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final]' type=.IFoo origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .DFoo declared in .DFoo.testExtFun' type=.DFoo origin=null $receiver: GET_VAR ': kotlin.String declared in .DFoo.testExtFun' type=kotlin.String origin=null PROPERTY DELEGATED_MEMBER name:testVal visibility:public modality:OPEN [val] @@ -97,7 +97,7 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .DFoo' CALL 'public abstract fun (): 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 + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .DFoo declared in .DFoo.' type=.DFoo origin=null PROPERTY DELEGATED_MEMBER name:testExtVal visibility:public modality:OPEN [val] annotations: @@ -113,10 +113,10 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .DFoo' CALL 'public abstract fun (): 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 + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .DFoo declared in .DFoo.' type=.DFoo origin=null $receiver: GET_VAR ': kotlin.String declared in .DFoo.' type=kotlin.String origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] EXPRESSION_BODY GET_VAR 'd: .IFoo declared in .DFoo.' type=.IFoo origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt index 41c418595ba..65a8050c479 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt @@ -32,26 +32,26 @@ class DFoo : IFoo { @Ann override fun testFun() { - .#<$$delegate_0>.testFun() + .#$$delegate_0.testFun() } @Ann override fun String.testExtFun() { - (.#<$$delegate_0>, ).testExtFun() + (.#$$delegate_0, ).testExtFun() } @Ann override val testVal: String override get(): String { - return .#<$$delegate_0>.() + return .#$$delegate_0.() } @Ann override val String.testExtVal: String override get(): String { - return (.#<$$delegate_0>, ).() + return (.#$$delegate_0, ).() } - local /* final field */ val <$$delegate_0>: IFoo = d + private /* final field */ val $$delegate_0: IFoo = d } diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.ir.txt index 3efc8fb49c0..6569b0b2f52 100644 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.ir.txt @@ -53,7 +53,7 @@ FILE fqName: fileName:/inheritingDeprecation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' CALL 'public open fun (): 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 + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val] annotations: @@ -69,10 +69,10 @@ FILE fqName: fileName:/inheritingDeprecation.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .Delegated' CALL 'public open fun (): 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 + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final]' type=.IFoo origin=null receiver: GET_VAR ': .Delegated declared in .Delegated.' type=.Delegated origin=null $receiver: GET_VAR ': kotlin.String declared in .Delegated.' type=kotlin.String origin=null - FIELD DELEGATE name:<$$delegate_0> type:.IFoo visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] EXPRESSION_BODY GET_VAR 'foo: .IFoo declared in .Delegated.' type=.IFoo origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt index 498f25fe25a..df765fbf362 100644 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt @@ -23,16 +23,16 @@ class Delegated : IFoo { @Deprecated(message = "") override val prop: String override get(): String { - return .#<$$delegate_0>.() + return .#$$delegate_0.() } @Deprecated(message = "") override val String.extProp: String override get(): String { - return (.#<$$delegate_0>, ).() + return (.#$$delegate_0, ).() } - local /* final field */ val <$$delegate_0>: IFoo = foo + private /* final field */ val $$delegate_0: IFoo = foo } diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt index 3b8a9216faf..cbce6dbadf1 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt @@ -44,10 +44,10 @@ FILE fqName: fileName:/kt35550.kt RETURN type=kotlin.Nothing from='public open fun (): T of .A. declared in .A' CALL 'public open fun (): T of .I. declared in .I' type=T of .A. origin=null : T of .A. - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.I visibility:local [final]' type=.I origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final]' type=.I origin=null receiver: GET_VAR ': .A declared in .A.' type=.A origin=null $receiver: GET_VAR ': T of .A. declared in .A.' type=T of .A. origin=null - FIELD DELEGATE name:<$$delegate_0> type:.I visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final] EXPRESSION_BODY GET_VAR 'i: .I declared in .A.' type=.I origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt index a8da794e1c7..3462ff3425e 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt @@ -15,9 +15,9 @@ class A : I { override val T.id: T override get(): T { - return (.#<$$delegate_0>, ).() + return (.#$$delegate_0, ).() } - local /* final field */ val <$$delegate_0>: I = i + private /* final field */ val $$delegate_0: I = i } diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt index b064fdf0410..be96ed439b8 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt @@ -42,7 +42,7 @@ FILE fqName: fileName:/delegatedMembers.kt VALUE_PARAMETER name:x index:0 type:kotlin.Int BLOCK_BODY CALL 'public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test> visibility:local [final]' type=.IBase.Test> origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final]' type=.IBase.Test> origin=null receiver: GET_VAR ': .Test.Test> declared in .Test.foo' type=.Test.Test> origin=null x: GET_VAR 'x: kotlin.Int declared in .Test.foo' type=kotlin.Int origin=null FUN DELEGATED_MEMBER name:qux visibility:public modality:OPEN ($this:.Test.Test>, t:TT of .Test, x:X of .Test.qux) returnType:kotlin.Unit @@ -55,7 +55,7 @@ FILE fqName: fileName:/delegatedMembers.kt BLOCK_BODY CALL 'public abstract fun qux (t: T of .IBase, x: X of .IBase.qux): kotlin.Unit declared in .IBase' type=kotlin.Unit origin=null : X of .Test.qux - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test> visibility:local [final]' type=.IBase.Test> origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final]' type=.IBase.Test> origin=null 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 @@ -70,9 +70,9 @@ FILE fqName: fileName:/delegatedMembers.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Test' CALL 'public abstract fun (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.IBase.Test> visibility:local [final]' type=.IBase.Test> origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [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] + FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility:private [final] EXPRESSION_BODY GET_VAR 'impl: .IBase.Test> declared in .Test.' type=.IBase.Test> origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt index c8ffbebf8be..953d2af98ef 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt @@ -15,18 +15,18 @@ class Test : IBase { } override fun foo(x: Int) { - .#<$$delegate_0>.foo(x = x) + .#$$delegate_0.foo(x = x) } override fun qux(t: TT, x: X) { - .#<$$delegate_0>.qux(t = t, x = x) + .#$$delegate_0.qux(t = t, x = x) } override val bar: Int override get(): Int { - return .#<$$delegate_0>.() + return .#$$delegate_0.() } - local /* final field */ val <$$delegate_0>: IBase = impl + private /* final field */ val $$delegate_0: IBase = impl } diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt index eb887ce1fd5..27618490ebc 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt @@ -115,7 +115,7 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun visitArray (): .Visitor? declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' CALL 'public open fun visitArray (): .Visitor? declared in .Visitor' type=.Visitor? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Visitor visibility:local [final]' type=.Visitor origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final]' type=.Visitor origin=null receiver: GET_VAR ': .AnnotationLoader.loadAnnotation..visitAnnotation. declared in .AnnotationLoader.loadAnnotation..visitAnnotation..visitArray' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=null FUN DELEGATED_MEMBER name:visitAnnotation visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:.Visitor? overridden: @@ -124,9 +124,9 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun visitAnnotation (): .Visitor? declared in .AnnotationLoader.loadAnnotation..visitAnnotation.' CALL 'public open fun visitAnnotation (): .Visitor? declared in .Visitor' type=.Visitor? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Visitor visibility:local [final]' type=.Visitor origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final]' type=.Visitor origin=null receiver: GET_VAR ': .AnnotationLoader.loadAnnotation..visitAnnotation. declared in .AnnotationLoader.loadAnnotation..visitAnnotation..visitAnnotation' type=.AnnotationLoader.loadAnnotation..visitAnnotation. origin=null - FIELD DELEGATE name:<$$delegate_0> type:.Visitor visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final] EXPRESSION_BODY GET_VAR 'val visitor: .Visitor [val] declared in .AnnotationLoader.loadAnnotation..visitAnnotation' type=.Visitor origin=null FUN name:visit visibility:public modality:FINAL <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt index 7e96f4877a7..2ae3a9976d6 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt @@ -59,14 +59,14 @@ class AnnotationLoader { } override fun visitArray(): Visitor? { - return .#<$$delegate_0>.visitArray() + return .#$$delegate_0.visitArray() } override fun visitAnnotation(): Visitor? { - return .#<$$delegate_0>.visitAnnotation() + return .#$$delegate_0.visitAnnotation() } - local /* final field */ val <$$delegate_0>: Visitor = visitor + private /* final field */ val $$delegate_0: Visitor = visitor override fun visit() { } diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt index 0de2c7286d7..b66f4a52eb5 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt @@ -15,7 +15,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Impl' CALL 'public abstract fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.add' type=.Impl origin=null element: GET_VAR 'element: @[FlexibleNullability] kotlin.String? declared in .Impl.add' type=@[FlexibleNullability] kotlin.String? origin=null FUN DELEGATED_MEMBER name:addAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean @@ -27,7 +27,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun addAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' CALL 'public abstract fun addAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.addAll' type=.Impl origin=null elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.addAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null FUN DELEGATED_MEMBER name:clear visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Unit @@ -37,7 +37,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt $this: VALUE_PARAMETER name: type:.Impl BLOCK_BODY CALL 'public abstract fun clear (): kotlin.Unit [fake_override] declared in .Foo.B' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.clear' type=.Impl origin=null FUN DELEGATED_MEMBER name:iterator visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> [operator] overridden: @@ -47,7 +47,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun iterator (): kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> [operator] declared in .Impl' CALL 'public abstract fun iterator (): kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> [fake_override,operator] declared in .Foo.B' type=kotlin.collections.MutableIterator<@[FlexibleNullability] kotlin.String?> origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.iterator' type=.Impl origin=null FUN DELEGATED_MEMBER name:remove visibility:public modality:OPEN <> ($this:.Impl, element:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Boolean overridden: @@ -58,7 +58,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun remove (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Impl' CALL 'public abstract fun remove (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.remove' type=.Impl origin=null element: GET_VAR 'element: @[FlexibleNullability] kotlin.String? declared in .Impl.remove' type=@[FlexibleNullability] kotlin.String? origin=null FUN DELEGATED_MEMBER name:removeAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean @@ -70,7 +70,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun removeAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' CALL 'public abstract fun removeAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.removeAll' type=.Impl origin=null elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.removeAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null FUN DELEGATED_MEMBER name:retainAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean @@ -82,7 +82,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun retainAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' CALL 'public abstract fun retainAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.retainAll' type=.Impl origin=null elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.retainAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null FUN DELEGATED_MEMBER name:contains visibility:public modality:OPEN <> ($this:.Impl, element:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Boolean [operator] @@ -94,7 +94,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun contains (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean [operator] declared in .Impl' CALL 'public abstract fun contains (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean [fake_override,operator] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.contains' type=.Impl origin=null element: GET_VAR 'element: @[FlexibleNullability] kotlin.String? declared in .Impl.contains' type=@[FlexibleNullability] kotlin.String? origin=null FUN DELEGATED_MEMBER name:containsAll visibility:public modality:OPEN <> ($this:.Impl, elements:kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>) returnType:kotlin.Boolean @@ -106,7 +106,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun containsAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean declared in .Impl' CALL 'public abstract fun containsAll (elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?>): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.containsAll' type=.Impl origin=null elements: GET_VAR 'elements: kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> declared in .Impl.containsAll' type=kotlin.collections.Collection<@[FlexibleNullability] kotlin.String?> origin=null FUN DELEGATED_MEMBER name:isEmpty visibility:public modality:OPEN <> ($this:.Impl) returnType:kotlin.Boolean @@ -117,7 +117,7 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun isEmpty (): kotlin.Boolean declared in .Impl' CALL 'public abstract fun isEmpty (): kotlin.Boolean [fake_override] declared in .Foo.B' type=kotlin.Boolean origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.isEmpty' type=.Impl origin=null PROPERTY DELEGATED_MEMBER name:size visibility:public modality:OPEN [val] overridden: @@ -132,9 +132,9 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun (): kotlin.Int declared in .Impl' CALL 'public abstract fun (): kotlin.Int [fake_override] declared in .Foo.B' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final]' type=.Foo.B origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final]' type=.Foo.B origin=null receiver: GET_VAR ': .Impl declared in .Impl.' type=.Impl origin=null - FIELD DELEGATE name:<$$delegate_0> type:.Foo.B visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.Foo.B visibility:private [final] EXPRESSION_BODY GET_VAR 'b: .Foo.B declared in .Impl.' type=.Foo.B origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt index 8e2feda8106..fec854a252a 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt @@ -6,51 +6,51 @@ class Impl : A, B { } override fun add(element: @FlexibleNullability String?): Boolean { - return .#<$$delegate_0>.add(element = element) + return .#$$delegate_0.add(element = element) } override fun addAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#<$$delegate_0>.addAll(elements = elements) + return .#$$delegate_0.addAll(elements = elements) } override fun clear() { - .#<$$delegate_0>.clear() + .#$$delegate_0.clear() } override operator fun iterator(): MutableIterator<@FlexibleNullability String?> { - return .#<$$delegate_0>.iterator() + return .#$$delegate_0.iterator() } override fun remove(element: @FlexibleNullability String?): Boolean { - return .#<$$delegate_0>.remove(element = element) + return .#$$delegate_0.remove(element = element) } override fun removeAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#<$$delegate_0>.removeAll(elements = elements) + return .#$$delegate_0.removeAll(elements = elements) } override fun retainAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#<$$delegate_0>.retainAll(elements = elements) + return .#$$delegate_0.retainAll(elements = elements) } override operator fun contains(element: @FlexibleNullability String?): Boolean { - return .#<$$delegate_0>.contains(element = element) + return .#$$delegate_0.contains(element = element) } override fun containsAll(elements: Collection<@FlexibleNullability String?>): Boolean { - return .#<$$delegate_0>.containsAll(elements = elements) + return .#$$delegate_0.containsAll(elements = elements) } override fun isEmpty(): Boolean { - return .#<$$delegate_0>.isEmpty() + return .#$$delegate_0.isEmpty() } override val size: Int override get(): Int { - return .#<$$delegate_0>.() + return .#$$delegate_0.() } - local /* final field */ val <$$delegate_0>: B = b + private /* final field */ val $$delegate_0: B = b } diff --git a/compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt b/compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt index 280a8e99fd0..60ec4e7abea 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt +++ b/compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt @@ -39,7 +39,7 @@ FILE fqName: fileName:/javaWildcardType.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun jf1 (): @[FlexibleNullability] kotlin.collections.MutableCollection? declared in .C' CALL 'public abstract fun jf1 (): @[FlexibleNullability] kotlin.collections.MutableCollection? declared in .J' type=@[FlexibleNullability] kotlin.collections.MutableCollection? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .C declared in .C.jf1' type=.C origin=null FUN DELEGATED_MEMBER name:jf2 visibility:public modality:OPEN <> ($this:.C) returnType:@[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? overridden: @@ -48,7 +48,7 @@ FILE fqName: fileName:/javaWildcardType.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun jf2 (): @[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .C' CALL 'public abstract fun jf2 (): @[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .J' type=@[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .C declared in .C.jf2' type=.C origin=null FUN DELEGATED_MEMBER name:jg1 visibility:public modality:OPEN <> ($this:.C, c:@[FlexibleNullability] kotlin.collections.MutableCollection?) returnType:kotlin.Unit overridden: @@ -57,7 +57,7 @@ FILE fqName: fileName:/javaWildcardType.kt VALUE_PARAMETER name:c index:0 type:@[FlexibleNullability] kotlin.collections.MutableCollection? BLOCK_BODY CALL 'public abstract fun jg1 (c: @[FlexibleNullability] kotlin.collections.MutableCollection?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .C declared in .C.jg1' type=.C origin=null c: GET_VAR 'c: @[FlexibleNullability] kotlin.collections.MutableCollection? declared in .C.jg1' type=@[FlexibleNullability] kotlin.collections.MutableCollection? origin=null FUN DELEGATED_MEMBER name:jg2 visibility:public modality:OPEN <> ($this:.C, c:@[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>?) returnType:kotlin.Unit @@ -67,10 +67,10 @@ FILE fqName: fileName:/javaWildcardType.kt VALUE_PARAMETER name:c index:0 type:@[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? BLOCK_BODY CALL 'public abstract fun jg2 (c: @[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>?): kotlin.Unit declared in .J' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final]' type=.J origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .C declared in .C.jg2' type=.C origin=null c: GET_VAR 'c: @[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .C.jg2' type=@[FlexibleNullability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? origin=null - FIELD DELEGATE name:<$$delegate_0> type:.J visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] EXPRESSION_BODY GET_VAR 'j: .J declared in .C.' type=.J origin=null FUN DELEGATED_MEMBER name:kf1 visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.collections.Collection @@ -80,7 +80,7 @@ FILE fqName: fileName:/javaWildcardType.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun kf1 (): kotlin.collections.Collection declared in .C' CALL 'public abstract fun kf1 (): kotlin.collections.Collection declared in .K' type=kotlin.collections.Collection origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.K visibility:local [final]' type=.K origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.K visibility:private [final]' type=.K origin=null receiver: GET_VAR ': .C declared in .C.kf1' type=.C origin=null FUN DELEGATED_MEMBER name:kf2 visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.collections.Collection overridden: @@ -89,7 +89,7 @@ FILE fqName: fileName:/javaWildcardType.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public open fun kf2 (): kotlin.collections.Collection declared in .C' CALL 'public abstract fun kf2 (): kotlin.collections.Collection declared in .K' type=kotlin.collections.Collection origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.K visibility:local [final]' type=.K origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.K visibility:private [final]' type=.K origin=null receiver: GET_VAR ': .C declared in .C.kf2' type=.C origin=null FUN DELEGATED_MEMBER name:kg1 visibility:public modality:OPEN <> ($this:.C, c:kotlin.collections.Collection) returnType:kotlin.Unit overridden: @@ -98,7 +98,7 @@ FILE fqName: fileName:/javaWildcardType.kt VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection BLOCK_BODY CALL 'public abstract fun kg1 (c: kotlin.collections.Collection): kotlin.Unit declared in .K' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.K visibility:local [final]' type=.K origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.K visibility:private [final]' type=.K origin=null receiver: GET_VAR ': .C declared in .C.kg1' type=.C origin=null c: GET_VAR 'c: kotlin.collections.Collection declared in .C.kg1' type=kotlin.collections.Collection origin=null FUN DELEGATED_MEMBER name:kg2 visibility:public modality:OPEN <> ($this:.C, c:kotlin.collections.Collection) returnType:kotlin.Unit @@ -108,10 +108,10 @@ FILE fqName: fileName:/javaWildcardType.kt VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection BLOCK_BODY CALL 'public abstract fun kg2 (c: kotlin.collections.Collection): kotlin.Unit declared in .K' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_1> type:.K visibility:local [final]' type=.K origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:.K visibility:private [final]' type=.K origin=null 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] + FIELD DELEGATE name:$$delegate_1 type:.K visibility:private [final] EXPRESSION_BODY GET_VAR 'k: .K declared in .C.' type=.K origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt b/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt index 2dddcccbd5d..a828aeb7ff6 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt +++ b/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt @@ -14,39 +14,39 @@ class C : J, K { } override fun jf1(): @FlexibleNullability MutableCollection? { - return .#<$$delegate_0>.jf1() + return .#$$delegate_0.jf1() } override fun jf2(): @FlexibleNullability MutableCollection<@FlexibleNullability CharSequence?>? { - return .#<$$delegate_0>.jf2() + return .#$$delegate_0.jf2() } override fun jg1(c: @FlexibleNullability MutableCollection?) { - .#<$$delegate_0>.jg1(c = c) + .#$$delegate_0.jg1(c = c) } override fun jg2(c: @FlexibleNullability MutableCollection<@FlexibleNullability CharSequence?>?) { - .#<$$delegate_0>.jg2(c = c) + .#$$delegate_0.jg2(c = c) } - local /* final field */ val <$$delegate_0>: J = j + private /* final field */ val $$delegate_0: J = j override fun kf1(): Collection { - return .#<$$delegate_1>.kf1() + return .#$$delegate_1.kf1() } override fun kf2(): Collection { - return .#<$$delegate_1>.kf2() + return .#$$delegate_1.kf2() } override fun kg1(c: Collection) { - .#<$$delegate_1>.kg1(c = c) + .#$$delegate_1.kg1(c = c) } override fun kg2(c: Collection) { - .#<$$delegate_1>.kg2(c = c) + .#$$delegate_1.kg2(c = c) } - local /* final field */ val <$$delegate_1>: K = k + private /* final field */ val $$delegate_1: K = k } diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt index 1be4bbd72b9..0e0a6fa4513 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt @@ -63,9 +63,9 @@ FILE fqName: fileName:/nullCheckOnInterfaceDelegation.kt RETURN type=kotlin.Nothing from='public open fun foo (): kotlin.String declared in .Delegated' TYPE_OP type=kotlin.String origin=IMPLICIT_NOTNULL typeOperand=kotlin.String CALL 'public final fun foo (): @[FlexibleNullability] kotlin.String? declared in .Derived' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.Derived visibility:local [final]' type=.Derived origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Derived visibility:private [final]' type=.Derived origin=null receiver: GET_VAR ': .Delegated declared in .Delegated.foo' type=.Delegated origin=null - FIELD DELEGATE name:<$$delegate_0> type:.Derived visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.Derived visibility:private [final] EXPRESSION_BODY CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Derived' type=.Derived origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt index 9172c9ef588..5f50bbcb605 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt @@ -28,10 +28,10 @@ class Delegated : IFoo { } override fun foo(): String { - return .#<$$delegate_0>.foo() /*!! String */ + return .#$$delegate_0.foo() /*!! String */ } - local /* final field */ val <$$delegate_0>: Derived = Derived() + private /* final field */ val $$delegate_0: Derived = Derived() } diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt index ec1890d9c88..b1cd15ddd4c 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt @@ -91,7 +91,7 @@ FILE fqName: fileName:/rawTypeInSignature.kt VALUE_PARAMETER name:list index:0 type:@[FlexibleNullability] @[RawType] kotlin.collections.MutableList BLOCK_BODY CALL 'public abstract fun takesRawList (list: @[FlexibleNullability] @[RawType] kotlin.collections.MutableList): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawList' type=.KRaw origin=null list: GET_VAR 'list: @[FlexibleNullability] @[RawType] kotlin.collections.MutableList declared in .KRaw.takesRawList' type=@[FlexibleNullability] @[RawType] kotlin.collections.MutableList origin=null FUN DELEGATED_MEMBER name:returnsRawList visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] kotlin.collections.MutableList @@ -102,7 +102,7 @@ FILE fqName: fileName:/rawTypeInSignature.kt RETURN type=kotlin.Nothing from='public open fun returnsRawList (): @[FlexibleNullability] @[RawType] kotlin.collections.MutableList declared in .KRaw' TYPE_OP type=@[RawType] kotlin.collections.MutableList origin=IMPLICIT_NOTNULL typeOperand=@[RawType] kotlin.collections.MutableList CALL 'public abstract fun returnsRawList (): @[FlexibleNullability] @[RawType] kotlin.collections.MutableList declared in .JRaw' type=@[FlexibleNullability] @[RawType] kotlin.collections.MutableList origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawList' type=.KRaw origin=null FUN DELEGATED_MEMBER name:takesRawGenericInv visibility:public modality:OPEN <> ($this:.KRaw, g:@[FlexibleNullability] @[RawType] .GenericInv) returnType:kotlin.Unit overridden: @@ -111,7 +111,7 @@ FILE fqName: fileName:/rawTypeInSignature.kt VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] .GenericInv BLOCK_BODY CALL 'public abstract fun takesRawGenericInv (g: @[FlexibleNullability] @[RawType] .GenericInv): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericInv' type=.KRaw origin=null g: GET_VAR 'g: @[FlexibleNullability] @[RawType] .GenericInv declared in .KRaw.takesRawGenericInv' type=@[FlexibleNullability] @[RawType] .GenericInv origin=null FUN DELEGATED_MEMBER name:returnsRawGenericInv visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] .GenericInv @@ -122,7 +122,7 @@ FILE fqName: fileName:/rawTypeInSignature.kt RETURN type=kotlin.Nothing from='public open fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv declared in .KRaw' TYPE_OP type=@[RawType] .GenericInv origin=IMPLICIT_NOTNULL typeOperand=@[RawType] .GenericInv CALL 'public abstract fun returnsRawGenericInv (): @[FlexibleNullability] @[RawType] .GenericInv declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericInv origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericInv' type=.KRaw origin=null FUN DELEGATED_MEMBER name:takesRawGenericIn visibility:public modality:OPEN <> ($this:.KRaw, g:@[FlexibleNullability] @[RawType] .GenericIn) returnType:kotlin.Unit overridden: @@ -131,7 +131,7 @@ FILE fqName: fileName:/rawTypeInSignature.kt VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] .GenericIn BLOCK_BODY CALL 'public abstract fun takesRawGenericIn (g: @[FlexibleNullability] @[RawType] .GenericIn): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericIn' type=.KRaw origin=null g: GET_VAR 'g: @[FlexibleNullability] @[RawType] .GenericIn declared in .KRaw.takesRawGenericIn' type=@[FlexibleNullability] @[RawType] .GenericIn origin=null FUN DELEGATED_MEMBER name:returnsRawGenericIn visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] .GenericIn @@ -142,7 +142,7 @@ FILE fqName: fileName:/rawTypeInSignature.kt RETURN type=kotlin.Nothing from='public open fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn declared in .KRaw' TYPE_OP type=@[RawType] .GenericIn origin=IMPLICIT_NOTNULL typeOperand=@[RawType] .GenericIn CALL 'public abstract fun returnsRawGenericIn (): @[FlexibleNullability] @[RawType] .GenericIn declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericIn origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericIn' type=.KRaw origin=null FUN DELEGATED_MEMBER name:takesRawGenericOut visibility:public modality:OPEN <> ($this:.KRaw, g:@[FlexibleNullability] @[RawType] .GenericOut) returnType:kotlin.Unit overridden: @@ -151,7 +151,7 @@ FILE fqName: fileName:/rawTypeInSignature.kt VALUE_PARAMETER name:g index:0 type:@[FlexibleNullability] @[RawType] .GenericOut BLOCK_BODY CALL 'public abstract fun takesRawGenericOut (g: @[FlexibleNullability] @[RawType] .GenericOut): kotlin.Unit declared in .JRaw' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.takesRawGenericOut' type=.KRaw origin=null g: GET_VAR 'g: @[FlexibleNullability] @[RawType] .GenericOut declared in .KRaw.takesRawGenericOut' type=@[FlexibleNullability] @[RawType] .GenericOut origin=null FUN DELEGATED_MEMBER name:returnsRawGenericOut visibility:public modality:OPEN <> ($this:.KRaw) returnType:@[FlexibleNullability] @[RawType] .GenericOut @@ -162,9 +162,9 @@ FILE fqName: fileName:/rawTypeInSignature.kt RETURN type=kotlin.Nothing from='public open fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut declared in .KRaw' TYPE_OP type=@[RawType] .GenericOut origin=IMPLICIT_NOTNULL typeOperand=@[RawType] .GenericOut CALL 'public abstract fun returnsRawGenericOut (): @[FlexibleNullability] @[RawType] .GenericOut declared in .JRaw' type=@[FlexibleNullability] @[RawType] .GenericOut origin=null - $this: GET_FIELD 'FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final]' type=.JRaw origin=null + $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final]' type=.JRaw origin=null receiver: GET_VAR ': .KRaw declared in .KRaw.returnsRawGenericOut' type=.KRaw origin=null - FIELD DELEGATE name:<$$delegate_0> type:.JRaw visibility:local [final] + FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final] EXPRESSION_BODY GET_VAR 'j: .JRaw declared in .KRaw.' type=.JRaw origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt index 58b7f95efed..7691fec9f74 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt @@ -45,37 +45,37 @@ class KRaw : JRaw { } override fun takesRawList(list: @FlexibleNullability @RawType MutableList) { - .#<$$delegate_0>.takesRawList(list = list) + .#$$delegate_0.takesRawList(list = list) } override fun returnsRawList(): @FlexibleNullability @RawType MutableList { - return .#<$$delegate_0>.returnsRawList() /*!! @RawType MutableList */ + return .#$$delegate_0.returnsRawList() /*!! @RawType MutableList */ } override fun takesRawGenericInv(g: @FlexibleNullability @RawType GenericInv) { - .#<$$delegate_0>.takesRawGenericInv(g = g) + .#$$delegate_0.takesRawGenericInv(g = g) } override fun returnsRawGenericInv(): @FlexibleNullability @RawType GenericInv { - return .#<$$delegate_0>.returnsRawGenericInv() /*!! @RawType GenericInv */ + return .#$$delegate_0.returnsRawGenericInv() /*!! @RawType GenericInv */ } override fun takesRawGenericIn(g: @FlexibleNullability @RawType GenericIn) { - .#<$$delegate_0>.takesRawGenericIn(g = g) + .#$$delegate_0.takesRawGenericIn(g = g) } override fun returnsRawGenericIn(): @FlexibleNullability @RawType GenericIn { - return .#<$$delegate_0>.returnsRawGenericIn() /*!! @RawType GenericIn */ + return .#$$delegate_0.returnsRawGenericIn() /*!! @RawType GenericIn */ } override fun takesRawGenericOut(g: @FlexibleNullability @RawType GenericOut) { - .#<$$delegate_0>.takesRawGenericOut(g = g) + .#$$delegate_0.takesRawGenericOut(g = g) } override fun returnsRawGenericOut(): @FlexibleNullability @RawType GenericOut { - return .#<$$delegate_0>.returnsRawGenericOut() /*!! @RawType GenericOut */ + return .#$$delegate_0.returnsRawGenericOut() /*!! @RawType GenericOut */ } - local /* final field */ val <$$delegate_0>: JRaw = j + private /* final field */ val $$delegate_0: JRaw = j } diff --git a/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt b/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt index 5776b40f136..d1744f0d9f2 100644 --- a/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt +++ b/core/compiler.common/src/org/jetbrains/kotlin/name/SpecialNames.kt @@ -101,4 +101,14 @@ object SpecialNames { fun isSafeIdentifier(name: Name): Boolean { return name.asString().isNotEmpty() && !name.isSpecial } + + @JvmStatic + fun delegateFieldName(index: Int): Name { + return Name.identifier("\$\$delegate_$index") + } + + @JvmStatic + fun propertyDelegateName(propertyName: Name): Name { + return Name.identifier("${propertyName.asString()}\$delegate") + } }