From 3d6ec0ec755ce36f01668bd47b6f5ce42aa8b007 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 5 Oct 2023 12:39:13 +0300 Subject: [PATCH] [FIR2IR] Automatically store IR declaration in its parent upon creation Previously, creating a declaration with Fir2IrCallableDeclarationsGenerator/ Fir2IrClassifiersGenerator didn't guarantee that this declaration will be actually added to the list of parent class/file declarations, which lead to situations when FIR2IR created some declarations in the air (mostly fake-overrides) --- .../fir/backend/Fir2IrClassifierStorage.kt | 7 - .../kotlin/fir/backend/Fir2IrConverter.kt | 129 +++++++----- .../generators/DataClassMembersGenerator.kt | 6 +- .../generators/DelegatedMemberGenerator.kt | 2 - .../generators/FakeOverrideGenerator.kt | 10 +- .../Fir2IrCallableDeclarationsGenerator.kt | 83 ++++++-- .../generators/Fir2IrClassifiersGenerator.kt | 20 +- .../selfReferentialAnnotation.fir.ir.txt | 12 +- .../delegationToIntersectionType.fir.ir.txt | 6 +- .../delegationToIntersectionType2.fir.ir.txt | 6 +- ...ithMultipleOverriddens_generics.fir.ir.txt | 8 +- ...hMultipleOverriddens_noGenerics.fir.ir.txt | 6 +- .../codegen/box/multiplatform/hmpp/simple.kt | 2 - .../k2/basic/expectInterfaceInSupertypes2.kt | 2 - .../dataClasses/delegationInSealed.fir.ir.txt | 22 +-- .../dataClasses/delegationInSealed.fir.kt.txt | 8 +- .../delegatedGenericImplementation.fir.ir.txt | 44 ++--- .../delegatedGenericImplementation.fir.kt.txt | 14 +- .../delegatedImplementation.fir.ir.txt | 20 +- .../delegatedImplementation.fir.kt.txt | 9 +- ...edImplementationOfJavaInterface.fir.ir.txt | 22 +-- ...edImplementationOfJavaInterface.fir.kt.txt | 9 +- ...lementationWithExplicitOverride.fir.ir.txt | 84 -------- ...lementationWithExplicitOverride.fir.kt.txt | 38 ---- ...gatedImplementationWithExplicitOverride.kt | 1 + ...uctorCallToTypeAliasConstructor.fir.ir.txt | 94 --------- ...uctorCallToTypeAliasConstructor.fir.kt.txt | 32 --- ...ngConstructorCallToTypeAliasConstructor.kt | 1 + ...otNullOnDelegatedImplementation.fir.ir.txt | 30 +-- ...otNullOnDelegatedImplementation.fir.kt.txt | 15 +- .../ir/irText/classes/kt45934.fir.ir.txt | 6 +- .../annotationsOnDelegatedMembers.fir.ir.txt | 6 +- .../annotationsOnDelegatedMembers.fir.kt.txt | 4 +- .../inheritingDeprecation.fir.ir.txt | 168 ---------------- .../inheritingDeprecation.fir.kt.txt | 63 ------ .../annotations/inheritingDeprecation.kt | 1 + .../typeAliasesWithAnnotations.fir.ir.txt | 37 ---- .../typeAliasesWithAnnotations.fir.kt.txt | 15 -- .../annotations/typeAliasesWithAnnotations.kt | 1 + .../delegationEvaluationOrder1.fir.ir.txt | 12 +- .../delegationEvaluationOrder1.fir.kt.txt | 4 +- .../delegationEvaluationOrder2.fir.ir.txt | 30 +-- .../delegationEvaluationOrder2.fir.kt.txt | 12 +- .../ir/irText/declarations/kt35550.fir.ir.txt | 6 +- .../ir/irText/declarations/kt35550.fir.kt.txt | 3 +- .../ir/irText/declarations/kt52677.fir.ir.txt | 186 ------------------ .../ir/irText/declarations/kt52677.fir.kt.txt | 88 --------- .../ir/irText/declarations/kt52677.kt | 1 + .../parameters/delegatedMembers.fir.ir.txt | 6 +- .../parameters/delegatedMembers.fir.kt.txt | 4 +- ...unInterfaceConstructorReference.fir.ir.txt | 6 +- ...unInterfaceConstructorReference.fir.kt.txt | 6 +- .../ir/irText/expressions/kt16905.fir.ir.txt | 2 +- .../ir/irText/expressions/kt16905.fir.kt.txt | 2 +- ...ializedTypeAliasConstructorCall.fir.ir.txt | 40 ---- ...ializedTypeAliasConstructorCall.fir.kt.txt | 17 -- .../specializedTypeAliasConstructorCall.kt | 1 + .../typeAliasConstructorReference.fir.ir.txt | 4 +- .../typeAliasConstructorReference.fir.kt.txt | 4 +- .../firProblems/AnnotationLoader.fir.ir.txt | 6 +- .../firProblems/AnnotationLoader.fir.kt.txt | 3 +- ...elegationAndInheritanceFromJava.fir.ir.txt | 6 +- ...elegationAndInheritanceFromJava.fir.kt.txt | 4 +- .../ErrorInDefaultValue.fir.ir.txt | 90 --------- .../ErrorInDefaultValue.fir.kt.txt | 34 ---- .../irText/firProblems/ErrorInDefaultValue.kt | 1 + ...errideInAnonymousWithDelegation.fir.ir.txt | 8 +- ...errideInAnonymousWithDelegation.fir.kt.txt | 4 +- .../Fir2IrClassifierStorage.fir.ir.txt | 22 +-- .../Fir2IrClassifierStorage.fir.kt.txt | 8 +- .../firProblems/SignatureClash.fir.ir.txt | 18 +- .../firProblems/SignatureClash.fir.kt.txt | 8 +- ...liasConstructorParameterMapping.fir.ir.txt | 148 -------------- ...liasConstructorParameterMapping.fir.kt.txt | 57 ------ .../TypeAliasConstructorParameterMapping.kt | 1 + .../ir/irText/firProblems/kt43342.fir.ir.txt | 22 +-- .../ir/irText/firProblems/kt43342.fir.kt.txt | 4 + ...ubstitutionOverrideWithDelegate.fir.ir.txt | 8 +- ...ubstitutionOverrideWithDelegate.fir.kt.txt | 4 +- .../regressions/integerCoercionToT.fir.ir.txt | 97 --------- .../regressions/integerCoercionToT.fir.kt.txt | 41 ---- .../irText/regressions/integerCoercionToT.kt | 1 + .../typeAliasCtorForGenericClass.fir.ir.txt | 47 ----- .../typeAliasCtorForGenericClass.fir.kt.txt | 19 -- .../typeAliasCtorForGenericClass.kt | 1 + .../ir/irText/singletons/enumEntry.fir.kt.txt | 1 + .../irText/types/javaWildcardType.fir.ir.txt | 132 ------------- .../irText/types/javaWildcardType.fir.kt.txt | 55 ------ .../ir/irText/types/javaWildcardType.kt | 1 + .../nullCheckOnInterfaceDelegation.fir.ir.txt | 88 --------- .../nullCheckOnInterfaceDelegation.fir.kt.txt | 41 ---- .../nullCheckOnInterfaceDelegation.kt | 1 + .../types/rawTypeInSignature.fir.ir.txt | 6 +- .../types/rawTypeInSignature.fir.kt.txt | 3 +- .../klib/dump-ir/typealias.ir.fir.txt | 6 +- .../klib/dump-ir/typealias.sig.ir.fir.txt | 6 +- 96 files changed, 417 insertions(+), 2062 deletions(-) delete mode 100644 compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/regressions/integerCoercionToT.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/regressions/integerCoercionToT.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt delete mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt delete mode 100644 compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt index c45d39b67ee..25be17cfdd3 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrClassifierStorage.kt @@ -9,21 +9,16 @@ import org.jetbrains.kotlin.descriptors.DescriptorVisibilities import org.jetbrains.kotlin.descriptors.Visibilities import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.fir.declarations.* -import org.jetbrains.kotlin.fir.declarations.utils.classId import org.jetbrains.kotlin.fir.declarations.utils.visibility import org.jetbrains.kotlin.fir.expressions.FirAnonymousObjectExpression import org.jetbrains.kotlin.fir.lazy.Fir2IrLazyClass import org.jetbrains.kotlin.fir.resolve.providers.firProvider import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider -import org.jetbrains.kotlin.fir.resolve.providers.toSymbol import org.jetbrains.kotlin.fir.resolve.toSymbol import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirTypeParameterSymbol -import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase -import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhaseWithCallableMembers import org.jetbrains.kotlin.fir.types.FirTypeRef -import org.jetbrains.kotlin.fir.types.toLookupTag import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.symbols.IrSymbol @@ -31,10 +26,8 @@ import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl import org.jetbrains.kotlin.ir.types.IrType -import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.name.SpecialNames -import org.jetbrains.kotlin.name.StandardClassIds class Fir2IrClassifierStorage( private val components: Fir2IrComponents, 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 ecf5dd3563c..2f871db8b2e 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 @@ -14,11 +14,14 @@ import org.jetbrains.kotlin.backend.common.actualizer.FakeOverrideRebuilder import org.jetbrains.kotlin.backend.common.sourceElement import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.config.LanguageFeature +import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.DescriptorVisibilities import org.jetbrains.kotlin.descriptors.Modality import org.jetbrains.kotlin.fir.* import org.jetbrains.kotlin.fir.analysis.checkers.toRegularClassSymbol import org.jetbrains.kotlin.fir.backend.generators.DataClassMembersGenerator +import org.jetbrains.kotlin.fir.backend.generators.addDeclarationToParent +import org.jetbrains.kotlin.fir.backend.generators.setParent import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.declarations.utils.isLocal import org.jetbrains.kotlin.fir.declarations.utils.isSynthetic @@ -165,20 +168,29 @@ class Fir2IrConverter( } private fun processClassHeaders(file: FirFile) { + val irFile = declarationStorage.getIrFile(file) file.declarations.forEach { when (it) { is FirRegularClass -> processClassAndNestedClassHeaders(it) - is FirTypeAlias -> classifierStorage.createAndCacheIrTypeAlias(it, declarationStorage.getIrFile(file)) + is FirTypeAlias -> { + classifierStorage.createAndCacheIrTypeAlias(it, irFile) + } else -> {} } } + /* + * This is needed to preserve the source order of declarations in the file + * IrFile should contain declarations in the source order, but creating of IrClass automatically adds created class to the list + * of file declaration. And in this step we skip all callables, so by default all classes will be declared before all callables + * To fix this issue the list of declarations is cleared at this point, and later it will be filled again in `processClassMembers` + */ + irFile.declarations.clear() } 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) } } @@ -188,6 +200,13 @@ class Fir2IrConverter( ) { registerNestedClasses(anonymousObject, irClass) processNestedClassHeaders(anonymousObject) + /* + * This is needed to preserve the source order of declarations in the class + * IrClass should contain declarations in the source order, but creating of nested IrClass automatically adds created class to the list + * of class declaration. And in this step we skip all callables, so by default all classes will be declared before all callables + * To fix this issue the list of declarations is cleared at this point, and later it will be filled again in `processClassMembers` + */ + irClass.declarations.clear() } internal fun processClassMembers(klass: FirClass, irClass: IrClass): IrClass { @@ -198,18 +217,15 @@ class Fir2IrConverter( addAll(klass.generatedNestedClassifiers(session)) } } + + irClass.declarations.addAll(classifierStorage.getFieldsWithContextReceiversForClass(irClass, klass)) + val irConstructor = klass.primaryConstructorIfAny(session)?.let { - declarationStorage.getOrCreateIrConstructor( - it.fir, irClass, isLocal = klass.isLocal - ) - } - if (irConstructor != null) { - irClass.declarations += irConstructor + declarationStorage.getOrCreateIrConstructor(it.fir, irClass, isLocal = klass.isLocal) } // 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, klass, irClass) ?: continue - irClass.declarations += irDeclaration + processMemberDeclaration(declaration, klass, irClass) } // Add delegated members *before* fake override generations. // Otherwise, fake overrides for delegated members, which are redundant, will be added. @@ -231,23 +247,20 @@ class Fir2IrConverter( declarationStorage.leaveScope(irConstructor.symbol) } with(fakeOverrideGenerator) { - irClass.addFakeOverrides(klass, allDeclarations) + irClass.computeFakeOverrides(klass, allDeclarations) } return irClass } - private fun processCodeFragmentMembers( - codeFragment: FirCodeFragment, - irClass: IrClass = classifierStorage.getCachedIrCodeFragment(codeFragment)!! - ): IrClass { + private fun processCodeFragmentMembers(codeFragment: FirCodeFragment, irClass: IrClass): IrClass { val conversionData = codeFragment.conversionData declarationStorage.enterScope(irClass.symbol) val signature = irClass.symbol.signature!! - val irPrimaryConstructor = symbolTable.declareConstructor(signature, { IrConstructorPublicSymbolImpl(signature) }) { irSymbol -> + symbolTable.declareConstructor(signature, { IrConstructorPublicSymbolImpl(signature) }) { irSymbol -> irFactory.createConstructor( UNDEFINED_OFFSET, UNDEFINED_OFFSET, IrDeclarationOrigin.DEFINED, @@ -260,7 +273,8 @@ class Fir2IrConverter( isExternal = false, isPrimary = true ).apply { - parent = irClass + setParent(irClass) + addDeclarationToParent(this, irClass) val firAnyConstructor = session.builtinTypes.anyType.toRegularClassSymbol(session)!!.fir.primaryConstructorIfAny(session)!! val irAnyConstructor = declarationStorage.getIrConstructorSymbol(firAnyConstructor) body = irFactory.createBlockBody(UNDEFINED_OFFSET, UNDEFINED_OFFSET).apply { @@ -275,7 +289,7 @@ class Fir2IrConverter( } } - val irFragmentFunction = symbolTable.declareSimpleFunction(signature, { IrSimpleFunctionPublicSymbolImpl(signature) }) { irSymbol -> + symbolTable.declareSimpleFunction(signature, { IrSimpleFunctionPublicSymbolImpl(signature) }) { irSymbol -> val lastStatement = codeFragment.block.statements.lastOrNull() val returnType = (lastStatement as? FirExpression)?.resolvedType?.toIrType(typeConverter) ?: irBuiltIns.unitType @@ -297,7 +311,8 @@ class Fir2IrConverter( containerSource = null, isFakeOverride = false ).apply fragmentFunction@{ - parent = irClass + setParent(irClass) + addDeclarationToParent(this, irClass) valueParameters = conversionData.injectedValues.mapIndexed { index, injectedValue -> val isMutated = injectedValue.isMutated @@ -320,9 +335,6 @@ class Fir2IrConverter( } } - irClass.declarations.add(irPrimaryConstructor) - irClass.declarations.add(irFragmentFunction) - declarationStorage.leaveScope(irClass.symbol) return irClass } @@ -399,6 +411,14 @@ class Fir2IrConverter( private fun processClassAndNestedClassHeaders(klass: FirClass) { classifiersGenerator.processClassHeader(klass) processNestedClassHeaders(klass) + val irClass = classifierStorage.getCachedIrClass(klass)!! + /* + * This is needed to preserve the source order of declarations in the class + * IrClass should contain declarations in the source order, but creating of nested IrClass automatically adds created class to the list + * of class declaration. And in this step we skip all callables, so by default all classes will be declared before all callables + * To fix this issue the list of declarations is cleared at this point, and later it will be filled again in `processFileAndClassMembers` + */ + irClass.declarations.clear() } private fun processNestedClassHeaders(klass: FirClass) { @@ -420,17 +440,28 @@ class Fir2IrConverter( declaration: FirDeclaration, containingClass: FirClass?, parent: IrDeclarationParent - ): IrDeclaration? { - val isLocal = containingClass != null && - (containingClass !is FirRegularClass || containingClass.isLocal) - return when (declaration) { + ) { + // This function is needed to preserve the source order of declaration in file + // see the comment in [processClassHeaders] function + fun addDeclarationToParentIfNeeded(irDeclaration: IrDeclaration) { + when (parent) { + is IrFile -> parent.declarations += irDeclaration + is IrClass -> parent.declarations += irDeclaration + } + } + + val isInLocalClass = containingClass != null && (containingClass !is FirRegularClass || containingClass.isLocal) + when (declaration) { is FirRegularClass -> { - processClassMembers(declaration, classifierStorage.getCachedIrClass(declaration)!!) + val irClass = classifierStorage.getCachedIrClass(declaration)!! + addDeclarationToParentIfNeeded(irClass) + processClassMembers(declaration, irClass) } is FirScript -> { - parent as IrFile - declarationStorage.getOrCreateIrScript(declaration).also { irScript -> - declarationStorage.enterScope(irScript.symbol) + require(parent is IrFile) + val irScript = declarationStorage.getOrCreateIrScript(declaration) + addDeclarationToParentIfNeeded(irScript) + declarationStorage.withScope(irScript.symbol) { irScript.parent = parent for (scriptStatement in declaration.statements) { when (scriptStatement) { @@ -447,41 +478,31 @@ class Fir2IrConverter( processMemberDeclaration(scriptStatement, null, irScript) } } - declarationStorage.leaveScope(irScript.symbol) } } is FirSimpleFunction -> { - declarationStorage.getOrCreateIrFunction( - declaration, parent, isLocal = isLocal - ) + declarationStorage.getOrCreateIrFunction(declaration, parent, isLocal = isInLocalClass) } is FirProperty -> { - if (containingClass != null && - declaration.isEnumEntries(containingClass) && - !session.languageVersionSettings.supportsFeature(LanguageFeature.EnumEntries) + if ( + containingClass == null || + !declaration.isEnumEntries(containingClass) || + 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( - declaration, parent, isLocal = isLocal - ) + declarationStorage.getOrCreateIrProperty(declaration, parent, isLocal = isInLocalClass) } } is FirField -> { if (declaration.isSynthetic) { callablesGenerator.createIrFieldAndDelegatedMembers(declaration, containingClass!!, parent as IrClass) } else { - throw AssertionError("Unexpected non-synthetic field: ${declaration::class}") + error("Unexpected non-synthetic field: ${declaration::class}") } } is FirConstructor -> if (!declaration.isPrimary) { - declarationStorage.getOrCreateIrConstructor( - declaration, parent as IrClass, isLocal = isLocal - ) - } else { - null + declarationStorage.getOrCreateIrConstructor(declaration, parent as IrClass, isLocal = isInLocalClass) } is FirEnumEntry -> { classifierStorage.getOrCreateIrEnumEntry(declaration, parent as IrClass) @@ -490,11 +511,15 @@ class Fir2IrConverter( declarationStorage.getOrCreateIrAnonymousInitializer(declaration, parent as IrClass) } is FirTypeAlias -> { - // DO NOTHING - null + classifierStorage.getCachedTypeAlias(declaration)?.let { irTypeAlias -> + // type alias may be local with error suppression, so it might be missing from classifier storage + addDeclarationToParentIfNeeded(irTypeAlias) + } } is FirCodeFragment -> { - processCodeFragmentMembers(declaration) + val codeFragmentClass = classifierStorage.getCachedIrCodeFragment(declaration)!! + processCodeFragmentMembers(declaration, codeFragmentClass) + addDeclarationToParentIfNeeded(codeFragmentClass) } else -> { error("Unexpected member: ${declaration::class}") diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt index c688423abd9..50619416588 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DataClassMembersGenerator.kt @@ -202,7 +202,6 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon toStringContributedFunction, components.irBuiltIns.stringType, ) - irClass.declarations.add(toStringFunction) declarationStorage.cacheGeneratedFunction(toStringContributedFunction, toStringFunction) } @@ -214,7 +213,6 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon hashcodeNameContributedFunction, components.irBuiltIns.intType, ) - irClass.declarations.add(hashCodeFunction) declarationStorage.cacheGeneratedFunction(hashcodeNameContributedFunction, hashCodeFunction) } @@ -228,7 +226,6 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon otherParameterNeeded = true, isOperator = true ) - irClass.declarations.add(equalsFunction) declarationStorage.cacheGeneratedFunction(equalsContributedFunction, equalsFunction) } @@ -329,7 +326,8 @@ class DataClassMembersGenerator(val components: Fir2IrComponents) : Fir2IrCompon metadata = FirMetadataSource.Function(syntheticCounterpart) } }.apply { - parent = irClass + setParent(irClass) + addDeclarationToParent(this, irClass) dispatchReceiverParameter = generateDispatchReceiverParameter(this) components.irBuiltIns.findBuiltInClassMemberFunctions( components.irBuiltIns.anyClass, diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt index 41f66eae2ff..f7c11423846 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/DelegatedMemberGenerator.kt @@ -125,7 +125,6 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I bodiesInfo += DeclarationBodyInfo(irSubFunction, irField, delegateToSymbol, delegateToLookupTag) declarationStorage.cacheDelegationFunction(functionSymbol.fir, irSubFunction) - subClass.addMember(irSubFunction) } subClassScope.processAllProperties { propertySymbol -> @@ -154,7 +153,6 @@ class DelegatedMemberGenerator(private val components: Fir2IrComponents) : Fir2I ) bodiesInfo += DeclarationBodyInfo(irSubProperty, irField, delegateToSymbol, delegateToLookupTag) declarationStorage.cacheDelegatedProperty(propertySymbol.fir, irSubProperty) - subClass.addMember(irSubProperty) } } diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt index e75f6efc27d..ea49ff4b531 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/FakeOverrideGenerator.kt @@ -51,14 +51,7 @@ class FakeOverrideGenerator( } } - fun IrClass.addFakeOverrides(klass: FirClass, declarations: Collection) { - this.declarations += getFakeOverrides( - klass, - declarations - ) - } - - private fun IrClass.getFakeOverrides(klass: FirClass, realDeclarations: Collection): List { + fun IrClass.computeFakeOverrides(klass: FirClass, realDeclarations: Collection) { val result = mutableListOf() val useSiteMemberScope = klass.unsubstitutedScope() @@ -68,7 +61,6 @@ class FakeOverrideGenerator( for (name in superTypesCallableNames) { generateFakeOverridesForName(this, useSiteMemberScope, name, klass, result, realDeclarationSymbols) } - return result } fun generateFakeOverridesForName( diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt index 0e89a1eca20..ea2253cde64 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrCallableDeclarationsGenerator.kt @@ -139,7 +139,7 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi if (isLambda) ((function as FirAnonymousFunction).typeRef as? FirResolvedTypeRef)?.type?.isSuspendOrKSuspendFunctionType(session) == true else function.isSuspend val created = function.convertWithOffsets { startOffset, endOffset -> - val result = declareIrSimpleFunction(signature) { symbol -> + declareIrSimpleFunction(signature) { symbol -> classifierStorage.preCacheTypeParameters(function, symbol) irFactory.createSimpleFunction( startOffset = if (updatedOrigin == IrDeclarationOrigin.DELEGATED_MEMBER) SYNTHETIC_OFFSET else startOffset, @@ -161,7 +161,14 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi ).apply { metadata = FirMetadataSource.Function(function) declarationStorage.withScope(symbol) { - setAndModifyParent(this, irParent) + /* + * `isLocal = true` indicates that a function is local or member of a local class + * containingClassLookupTag allows to distinguish those two cases + */ + setParent(irParent) + if (!(isLocal && function.containingClassLookupTag() == null)) { + addDeclarationToParent(this, irParent) + } declareParameters( function, irParent, dispatchReceiverType = computeDispatchReceiverType(this, simpleFunction, irParent), @@ -172,7 +179,6 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi } } } - result } if (visibility == Visibilities.Local) { @@ -245,7 +251,8 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi @OptIn(LeakedDeclarationCaches::class) declarationStorage.cacheIrConstructor(constructor, this) declarationStorage.withScope(symbol) { - setAndModifyParent(this, irParent) + setParent(irParent) + addDeclarationToParent(this, irParent) declareParameters(constructor, irParent, dispatchReceiverType = null, isStatic = false, forSetter = false) } } @@ -321,9 +328,9 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi metadata = FirMetadataSource.Property(property) convertAnnotationsForNonDeclaredMembers(property, origin) declarationStorage.withScope(symbol) { - if (irParent != null) { - parent = irParent - } + // IrProperty is never created for local variables + setParent(irParent) + addDeclarationToParent(this, irParent) val type = property.returnTypeRef.toIrType() val delegate = property.delegate val getter = property.getter @@ -528,7 +535,9 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi firValueParameter = null ) } - setAndModifyParent(this, irParent) + // property accessors does not belong to declarations of class/file, but are referenced via property, + // so there is no need to add accessor to list of parents declarations + setParent(irParent) declareParameters( propertyAccessor, irParent, dispatchReceiverType, isStatic = irParent !is IrClass || propertyAccessor?.isStatic == true, forSetter = isSetter, @@ -651,7 +660,14 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi if (initializer is FirConstExpression<*>) { this.initializer = factory.createExpressionBody(initializer.toIrConst(irType)) } - setAndModifyParent(this, irParent) + /* + * fields of regular properties are stored inside IrProperty + * fields for delegates (inheritance by delegation) are stored in the corresponding class directly + */ + setParent(irParent) + if (origin == IrDeclarationOrigin.DELEGATE) { + addDeclarationToParent(this, irParent) + } } } } @@ -981,7 +997,8 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi IrDeclarationOrigin.DEFINED, irParent.descriptor ).apply { - this.parent = irParent + setParent(irParent) + addDeclarationToParent(this, irParent) } } } @@ -1051,15 +1068,6 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi } } - fun setAndModifyParent(declaration: IrDeclaration, irParent: IrDeclarationParent?) { - if (irParent != null) { - declaration.parent = irParent - if (irParent is IrExternalPackageFragment) { - irParent.declarations += declaration - } - } - } - private fun IrMutableAnnotationContainer.convertAnnotationsForNonDeclaredMembers( firAnnotationContainer: FirAnnotationContainer, origin: IrDeclarationOrigin, ) { @@ -1082,3 +1090,40 @@ class Fir2IrCallableDeclarationsGenerator(val components: Fir2IrComponents) : Fi } } } + +internal fun IrDeclaration.setParent(irParent: IrDeclarationParent?) { + if (irParent != null) { + parent = irParent + } +} + +/** + * We should not try to add declaration to list of parents declarations in two cases: + * 1. getters, setters, and backing fields are not stored in parent directly. They are stored in IrProperty instead, + * which is stored in parent + * 2. if a declaration is declared in a local scope (in some body) then it will have contained class/function as a parent. But the declaration + * should be listed in statements list of the corresponding IrBlock instead of IrClass.declarations + * Note that IrClass will be a parent if some declaration is declared inside anonymous initializer, because IrAnonymousInitializer + * is not a IrDeclarationParent + */ +internal fun addDeclarationToParent(declaration: IrDeclaration, irParent: IrDeclarationParent?) { + if (irParent == null) return + when (irParent) { + is Fir2IrLazyClass -> { + /* + * Declaration list of lazy class is lazy by itself, and it will collect and store all required members + * automatically on the first access to Fir2IrLazyClass.declarations + */ + } + is IrClass -> irParent.declarations += declaration + is IrFile -> irParent.declarations += declaration + is IrExternalPackageFragment -> irParent.declarations += declaration + is IrScript -> { + /* + * All declarations of the script will be added during main script conversion + */ + } + else -> error("Can't add declaration ${declaration.render()} to parent ${irParent.render()}") + } +} + diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrClassifiersGenerator.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrClassifiersGenerator.kt index 6cc9680c7bf..7b1c3f03a82 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrClassifiersGenerator.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/generators/Fir2IrClassifiersGenerator.kt @@ -146,7 +146,14 @@ class Fir2IrClassifiersGenerator(val components: Fir2IrComponents) : Fir2IrCompo } } } - irClass.parent = parent + /* + * `regularClass.isLocal` indicates that either class itsef is local or it is a nested class in some other class + * Check for parentClassId allows to distinguish between those cases + */ + irClass.setParent(parent) + if (!(regularClass.isLocal && regularClass.classId.parentClassId == null)) { + addDeclarationToParent(irClass, parent) + } return irClass } @@ -347,9 +354,8 @@ class Fir2IrClassifiersGenerator(val components: Fir2IrComponents) : Fir2IrCompo ).apply { this.parent = parent setTypeParameters(this, typeAlias) - if (parent is IrFile) { - parent.declarations += this - } + setParent(parent) + addDeclarationToParent(this, parent) } irTypeAlias } @@ -382,7 +388,8 @@ class Fir2IrClassifiersGenerator(val components: Fir2IrComponents) : Fir2IrCompo hasEnumEntries = false, ).apply { metadata = FirMetadataSource.CodeFragment(codeFragment) - parent = containingFile + setParent(containingFile) + addDeclarationToParent(this, containingFile) typeParameters = emptyList() thisReceiver = declareThisReceiverParameter( thisType = IrSimpleTypeImpl(symbol, false, emptyList(), emptyList()), @@ -421,7 +428,8 @@ class Fir2IrClassifiersGenerator(val components: Fir2IrComponents) : Fir2IrCompo symbol = symbol, ).apply { declarationStorage.enterScope(this.symbol) - this.parent = irParent + setParent(irParent) + addDeclarationToParent(this, irParent) if (isEnumEntryWhichRequiresSubclass(enumEntry)) { // An enum entry with its own members requires an anonymous object generated. // Otherwise, this is a default-ish enum entry whose initializer would be a delegating constructor call, diff --git a/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt b/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt index ed48039e60e..185362ecc21 100644 --- a/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt +++ b/compiler/testData/codegen/box/annotations/selfReferentialAnnotation.fir.ir.txt @@ -72,17 +72,17 @@ FILE fqName: fileName:/selfReferentialAnnotation.kt receiver: GET_VAR ': .MyRequiresOptIn declared in .MyRequiresOptIn.' type=.MyRequiresOptIn origin=null CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyRequiresOptIn.MyLevel>] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MyRequiresOptIn.MyLevel + ENUM_ENTRY name:ERROR + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyRequiresOptIn.MyLevel' + ENUM_ENTRY name:WARNING + init: EXPRESSION_BODY + ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyRequiresOptIn.MyLevel' CONSTRUCTOR visibility:private <> () returnType:.MyRequiresOptIn.MyLevel [primary] BLOCK_BODY ENUM_CONSTRUCTOR_CALL 'public constructor (name: kotlin.String, ordinal: kotlin.Int) declared in kotlin.Enum' : .MyRequiresOptIn.MyLevel INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ENUM_CLASS name:MyLevel modality:FINAL visibility:public superTypes:[kotlin.Enum<.MyRequiresOptIn.MyLevel>]' - ENUM_ENTRY name:WARNING - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyRequiresOptIn.MyLevel' - ENUM_ENTRY name:ERROR - init: EXPRESSION_BODY - ENUM_CONSTRUCTOR_CALL 'private constructor () declared in .MyRequiresOptIn.MyLevel' FUN ENUM_CLASS_SPECIAL_MEMBER name:values visibility:public modality:FINAL <> () returnType:kotlin.Array<.MyRequiresOptIn.MyLevel> SYNTHETIC_BODY kind=ENUM_VALUES FUN ENUM_CLASS_SPECIAL_MEMBER name:valueOf visibility:public modality:FINAL <> (value:kotlin.String) returnType:.MyRequiresOptIn.MyLevel diff --git a/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt b/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt index e7071524a21..8e43fd409bd 100644 --- a/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt +++ b/compiler/testData/codegen/box/delegation/delegationToIntersectionType.fir.ir.txt @@ -114,6 +114,9 @@ FILE fqName: fileName:/delegationToIntersectionType.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.B]' + FIELD DELEGATE name:$$delegate_0 type:.A visibility:private [final] + EXPRESSION_BODY + GET_VAR 'val intersection: .A declared in .test' type=.A origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.test.) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .B @@ -124,9 +127,6 @@ FILE fqName: fileName:/delegationToIntersectionType.kt $this: TYPE_OP type=.B origin=IMPLICIT_CAST typeOperand=.B GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.A visibility:private [final]' type=.A origin=null receiver: GET_VAR ': .test. declared in .test..foo' type=.test. origin=null - FIELD DELEGATE name:$$delegate_0 type:.A visibility:private [final] - EXPRESSION_BODY - GET_VAR 'val intersection: .A declared in .test' type=.A origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B diff --git a/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt b/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt index ab966622b65..ee7af4d90d7 100644 --- a/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt +++ b/compiler/testData/codegen/box/delegation/delegationToIntersectionType2.fir.ir.txt @@ -119,6 +119,9 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.A]' + FIELD DELEGATE name:$$delegate_0 type:.A visibility:private [final] + EXPRESSION_BODY + GET_VAR 'val intersection: .A declared in .test' type=.A origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.test.) returnType:kotlin.Any overridden: public abstract fun foo (): kotlin.Any declared in .A @@ -129,9 +132,6 @@ FILE fqName: fileName:/delegationToIntersectionType2.kt $this: TYPE_OP type=.B origin=IMPLICIT_CAST typeOperand=.B GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.A visibility:private [final]' type=.A origin=null receiver: GET_VAR ': .test. declared in .test..foo' type=.test. origin=null - FIELD DELEGATE name:$$delegate_0 type:.A visibility:private [final] - EXPRESSION_BODY - GET_VAR 'val intersection: .A declared in .test' type=.A origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt index f73f455c4dd..86f667f9629 100644 --- a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_generics.fir.ir.txt @@ -197,6 +197,10 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null + : kotlin.String FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String overridden: public abstract fun foo (): E3 of .MyMutableCollection declared in .MyMutableCollection @@ -219,10 +223,6 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_generics.k CALL 'public open fun (): E6 of .MyArrayList declared in .MyArrayList' type=E6 of .MyArrayList origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null - FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null - : kotlin.String FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection diff --git a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt index 2975c3fdbed..2a7703bf383 100644 --- a/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt +++ b/compiler/testData/codegen/box/functions/delegatedPropertyWithMultipleOverriddens_noGenerics.fir.ir.txt @@ -188,6 +188,9 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:MC modality:FINAL visibility:public superTypes:[.MyMutableCollection]' + FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.MC) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .MyMutableCollection @@ -210,9 +213,6 @@ FILE fqName: fileName:/delegatedPropertyWithMultipleOverriddens_noGenerics CALL 'public open fun (): kotlin.String declared in .MyArrayList' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final]' type=.MyArrayList origin=null receiver: GET_VAR ': .MC declared in .MC.' type=.MC origin=null - FIELD DELEGATE name:$$delegate_0 type:.MyArrayList visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .MyArrayList' type=.MyArrayList origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MyMutableCollection diff --git a/compiler/testData/codegen/box/multiplatform/hmpp/simple.kt b/compiler/testData/codegen/box/multiplatform/hmpp/simple.kt index 771865e9d15..05e9a5091e0 100644 --- a/compiler/testData/codegen/box/multiplatform/hmpp/simple.kt +++ b/compiler/testData/codegen/box/multiplatform/hmpp/simple.kt @@ -7,8 +7,6 @@ // !LANGUAGE: +MultiPlatformProjects // IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION: KT-62535 // TARGET_BACKEND: JVM -// IGNORE_BACKEND_K2: JVM_IR -// REASON: K2 incorrectly generates IR for B.bar f/o // MODULE: common // TARGET_PLATFORM: Common diff --git a/compiler/testData/codegen/box/multiplatform/k2/basic/expectInterfaceInSupertypes2.kt b/compiler/testData/codegen/box/multiplatform/k2/basic/expectInterfaceInSupertypes2.kt index baa1fcef6b1..8fe1277693f 100644 --- a/compiler/testData/codegen/box/multiplatform/k2/basic/expectInterfaceInSupertypes2.kt +++ b/compiler/testData/codegen/box/multiplatform/k2/basic/expectInterfaceInSupertypes2.kt @@ -2,8 +2,6 @@ // WITH_STDLIB // IGNORE_CODEGEN_WITH_IR_FAKE_OVERRIDE_GENERATION: KT-62535 // !LANGUAGE: +MultiPlatformProjects -// IGNORE_BACKEND_K2: ANY -// REASON: K2 incorrectly generates IR for S2.s3 f/o // MODULE: common // TARGET_PLATFORM: Common diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt index c99634f168c..e94b2444573 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.ir.txt @@ -14,6 +14,17 @@ FILE fqName: fileName:/delegationInSealed.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'protected constructor () declared in .A' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public [data] superTypes:[.A; kotlin.CharSequence]' + PROPERTY name:c visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final] + EXPRESSION_BODY + GET_VAR 'c: kotlin.CharSequence declared in .A.B.' type=kotlin.CharSequence origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A.B) returnType:kotlin.CharSequence + correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.A.B + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.CharSequence declared in .A.B' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null + receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null FUN DELEGATED_MEMBER name:get visibility:public modality:OPEN <> ($this:.A.B, index:kotlin.Int) returnType:kotlin.Char [operator] overridden: public abstract fun get (index: kotlin.Int): kotlin.Char declared in .A @@ -55,17 +66,6 @@ FILE fqName: fileName:/delegationInSealed.kt CALL 'public abstract fun (): kotlin.Int declared in kotlin.CharSequence' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null - PROPERTY name:c visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final] - EXPRESSION_BODY - GET_VAR 'c: kotlin.CharSequence declared in .A.B.' type=kotlin.CharSequence origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A.B) returnType:kotlin.CharSequence - correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A.B - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.CharSequence declared in .A.B' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.CharSequence visibility:private [final]' type=kotlin.CharSequence origin=null - receiver: GET_VAR ': .A.B declared in .A.B.' type=.A.B origin=null FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.A.B) returnType:kotlin.CharSequence [operator] $this: VALUE_PARAMETER name: type:.A.B BLOCK_BODY diff --git a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt index 59d242913f9..bd76190d66e 100644 --- a/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/dataClasses/delegationInSealed.fir.kt.txt @@ -12,6 +12,10 @@ sealed class A : CharSequence { } + val c: CharSequence + field = c + get + override operator fun get(index: Int): Char { return .#c.get(index = index) } @@ -25,10 +29,6 @@ sealed class A : CharSequence { return .#c.() } - val c: CharSequence - field = c - get - operator fun component1(): CharSequence { return .#c } diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt index 3f2dfd9d76b..2d6aa877113 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.ir.txt @@ -46,6 +46,9 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase.Test1>]' + 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 DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test1.Test1>, a:E of .Test1, b:B of .Test1.foo) returnType:kotlin.Unit overridden: public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase @@ -109,9 +112,6 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt 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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBase @@ -132,6 +132,25 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase]' + PROPERTY name:j visibility:public modality:FINAL [var] + FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private + EXPRESSION_BODY + GET_VAR 'j: .IBase declared in .Test2.' type=.IBase origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:.IBase + correspondingProperty: PROPERTY name:j visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Test2 + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): .IBase declared in .Test2' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=.IBase origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2, :.IBase) returnType:kotlin.Unit + correspondingProperty: PROPERTY name:j visibility:public modality:FINAL [var] + $this: VALUE_PARAMETER name: type:.Test2 + VALUE_PARAMETER name: index:0 type:.IBase + BLOCK_BODY + SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=kotlin.Unit origin=null + receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null + value: GET_VAR ': .IBase declared in .Test2.' type=.IBase origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.Test2, a:kotlin.String, b:B of .Test2.foo) returnType:kotlin.Unit overridden: public abstract fun foo (a: A of .IBase, b: B of .IBase.foo): kotlin.Unit declared in .IBase @@ -195,25 +214,6 @@ FILE fqName: fileName:/delegatedGenericImplementation.kt receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null $receiver: GET_VAR ': kotlin.collections.List.Test2.> declared in .Test2.' type=kotlin.collections.List.Test2.> origin=null : GET_VAR ': D of .Test2.? declared in .Test2.' type=D of .Test2.? origin=null - PROPERTY name:j visibility:public modality:FINAL [var] - FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private - EXPRESSION_BODY - GET_VAR 'j: .IBase declared in .Test2.' type=.IBase origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2) returnType:.IBase - correspondingProperty: PROPERTY name:j visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Test2 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .IBase declared in .Test2' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=.IBase origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Test2, :.IBase) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:j visibility:public modality:FINAL [var] - $this: VALUE_PARAMETER name: type:.Test2 - VALUE_PARAMETER name: index:0 type:.IBase - BLOCK_BODY - SET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.IBase visibility:private' type=kotlin.Unit origin=null - receiver: GET_VAR ': .Test2 declared in .Test2.' type=.Test2 origin=null - value: GET_VAR ': .IBase declared in .Test2.' type=.IBase origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBase diff --git a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt index 862c82da0ad..2f45aae0f6c 100644 --- a/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedGenericImplementation.fir.kt.txt @@ -17,6 +17,7 @@ class Test1 : IBase { } + private /* final field */ val $$delegate_0: IBase = i override fun foo(a: E, b: B) { .#$$delegate_0.foo(a = a, b = b) } @@ -34,8 +35,6 @@ class Test1 : IBase { (.#$$delegate_0, ).( = ) } - private /* final field */ val $$delegate_0: IBase = i - } class Test2 : IBase { @@ -45,6 +44,11 @@ class Test2 : IBase { } + var j: IBase + field = j + get + set + override fun foo(a: String, b: B) { .#j.foo(a = a, b = b) } @@ -62,9 +66,5 @@ class Test2 : IBase { (.#j, ).( = ) } - var j: IBase - field = j - get - set - } + diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt index 261eaca2b60..3da78e24742 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.ir.txt @@ -208,6 +208,9 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test1 modality:FINAL visibility:public superTypes:[.IBase]' + 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 DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test1, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit overridden: public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase @@ -239,9 +242,6 @@ FILE fqName: fileName:/delegatedImplementation.kt $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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBase @@ -261,6 +261,9 @@ FILE fqName: fileName:/delegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test2 modality:FINAL visibility:public superTypes:[.IBase; .IOther]' + 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 DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test2, x:kotlin.Int, s:kotlin.String) returnType:kotlin.Unit overridden: public abstract fun foo (x: kotlin.Int, s: kotlin.String): kotlin.Unit declared in .IBase @@ -292,9 +295,11 @@ FILE fqName: fileName:/delegatedImplementation.kt $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:private [final] + FIELD DELEGATE name:$$delegate_1 type:.IOther visibility:private [final] EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:BaseImpl modality:FINAL visibility:public superTypes:[.IBase]' type=.BaseImpl + 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="" + y0: CONST Int type=kotlin.Int value=42 PROPERTY DELEGATED_MEMBER name:x visibility:public modality:OPEN [val] overridden: public abstract x: kotlin.String @@ -375,11 +380,6 @@ FILE fqName: fileName:/delegatedImplementation.kt 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: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="" - y0: CONST Int type=kotlin.Int value=42 FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBase diff --git a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt index 481881c2433..f06f560b1b2 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementation.fir.kt.txt @@ -86,6 +86,7 @@ class Test1 : IBase { } + private /* final field */ val $$delegate_0: BaseImpl = BaseImpl override fun foo(x: Int, s: String) { .#$$delegate_0.foo(x = x, s = s) } @@ -98,8 +99,6 @@ class Test1 : IBase { (.#$$delegate_0, ).qux() } - private /* final field */ val $$delegate_0: BaseImpl = BaseImpl - } class Test2 : IBase, IOther { @@ -109,6 +108,7 @@ class Test2 : IBase, IOther { } + private /* final field */ val $$delegate_0: BaseImpl = BaseImpl override fun foo(x: Int, s: String) { .#$$delegate_0.foo(x = x, s = s) } @@ -121,7 +121,7 @@ class Test2 : IBase, IOther { (.#$$delegate_0, ).qux() } - private /* final field */ val $$delegate_0: BaseImpl = BaseImpl + private /* final field */ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42) override val x: String override get(): String { return .#$$delegate_1.() @@ -148,6 +148,5 @@ class Test2 : IBase, IOther { (.#$$delegate_1, ).( = ) } - private /* final field */ val $$delegate_1: IOther = otherImpl(x0 = "", y0 = 42) - } + diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt index e2a500025cf..ac91e8140af 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.ir.txt @@ -6,6 +6,17 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.J]' + PROPERTY name:j visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final] + EXPRESSION_BODY + GET_VAR 'j: .J declared in .Test.' type=.J origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Test) returnType:.J + correspondingProperty: PROPERTY name:j visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Test + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): .J declared in .Test' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null + receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null FUN DELEGATED_MEMBER name:takeNotNull visibility:public modality:OPEN <> ($this:.Test, x:@[EnhancedNullability] kotlin.String) returnType:kotlin.Unit overridden: public abstract fun takeNotNull (x: @[EnhancedNullability] kotlin.String): kotlin.Unit declared in .J @@ -72,17 +83,6 @@ FILE fqName: fileName:/delegatedImplementationOfJavaInterface.kt CALL 'public abstract fun returnsFlexible (): @[FlexibleNullability] kotlin.String? declared in .J' type=@[FlexibleNullability] kotlin.String? origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null receiver: GET_VAR ': .Test declared in .Test.returnsFlexible' type=.Test origin=null - PROPERTY name:j visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final] - EXPRESSION_BODY - GET_VAR 'j: .J declared in .Test.' type=.J origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Test) returnType:.J - correspondingProperty: PROPERTY name:j visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Test - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): .J declared in .Test' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:j type:.J visibility:private [final]' type=.J origin=null - receiver: GET_VAR ': .Test declared in .Test.' type=.Test origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt index 35defedd410..b0242e148dd 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationOfJavaInterface.fir.kt.txt @@ -5,6 +5,10 @@ class Test : J { } + private val j: J + field = j + private get + override fun takeNotNull(@NotNull x: @EnhancedNullability String) { .#j.takeNotNull(x = x) } @@ -31,8 +35,5 @@ class Test : J { return .#j.returnsFlexible() } - private val j: J - field = j - private get - } + diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt deleted file mode 100644 index 34e8d8d2221..00000000000 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.ir.txt +++ /dev/null @@ -1,84 +0,0 @@ -FILE fqName: fileName:/delegatedImplementationWithExplicitOverride.kt - CLASS INTERFACE name:IFooBar modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFooBar - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFooBar - FUN name:bar visibility:public modality:ABSTRACT <> ($this:.IFooBar) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.IFooBar - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.FooBarImpl - CONSTRUCTOR visibility:private <> () returnType:.FooBarImpl [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar]' - FUN name:foo visibility:public modality:OPEN <> ($this:.FooBarImpl) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER name: type:.FooBarImpl - BLOCK_BODY - FUN name:bar visibility:public modality:OPEN <> ($this:.FooBarImpl) returnType:kotlin.Unit - overridden: - public abstract fun bar (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER name: type:.FooBarImpl - BLOCK_BODY - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.IFooBar] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> () returnType:.C [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.IFooBar]' - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Unit - overridden: - public abstract fun foo (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - CALL 'public open fun foo (): kotlin.Unit declared in .FooBarImpl' type=kotlin.Unit 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:private [final] - EXPRESSION_BODY - GET_OBJECT 'CLASS OBJECT name:FooBarImpl modality:FINAL visibility:public superTypes:[.IFooBar]' type=.FooBarImpl - FUN name:bar visibility:public modality:OPEN <> ($this:.C) returnType:kotlin.Unit - overridden: - public abstract fun bar (): kotlin.Unit declared in .IFooBar - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .IFooBar - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt deleted file mode 100644 index fe85467fb19..00000000000 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.fir.kt.txt +++ /dev/null @@ -1,38 +0,0 @@ -interface IFooBar { - abstract fun foo() - - abstract fun bar() - -} - -object FooBarImpl : IFooBar { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun foo() { - } - - override fun bar() { - } - -} - -class C : IFooBar { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun foo() { - .#$$delegate_0.foo() - } - - private /* final field */ val $$delegate_0: FooBarImpl = FooBarImpl - override fun bar() { - } - -} diff --git a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt index 21e66b68421..e6b445c5891 100644 --- a/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt +++ b/compiler/testData/ir/irText/classes/delegatedImplementationWithExplicitOverride.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IFooBar { fun foo() fun bar() diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.ir.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.ir.txt deleted file mode 100644 index c9f6f0a7a82..00000000000 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.ir.txt +++ /dev/null @@ -1,94 +0,0 @@ -FILE fqName: fileName:/delegatingConstructorCallToTypeAliasConstructor.kt - TYPEALIAS name:CT visibility:public expandedType:.Cell.CT> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:CStr visibility:public expandedType:.Cell - CLASS CLASS name:Cell modality:OPEN visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell.Cell> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Cell - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:OPEN visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .Cell declared in .Cell.' type=T of .Cell origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>) returnType:T of .Cell - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Cell.Cell> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final]' type=T of .Cell origin=null - receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C1 - CONSTRUCTOR visibility:public <> () returnType:.C1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' - : kotlin.String - value: CONST String type=kotlin.String value="O" - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C1 modality:FINAL visibility:public superTypes:[.Cell]' - PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final value: T of .Cell - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): T of .Cell declared in .Cell - $this: VALUE_PARAMETER name: type:.Cell - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C2 - CONSTRUCTOR visibility:public <> () returnType:.C2 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' - : kotlin.String - value: CONST String type=kotlin.String value="K" - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C2 modality:FINAL visibility:public superTypes:[.Cell]' - PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final value: T of .Cell - FUN FAKE_OVERRIDE name: visibility:public modality:FINAL <> ($this:.Cell) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:value visibility:public modality:FINAL [fake_override,val] - overridden: - public final fun (): T of .Cell declared in .Cell - $this: VALUE_PARAMETER name: type:.Cell - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .Cell - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.kt.txt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.kt.txt deleted file mode 100644 index 3fce7ec5c13..00000000000 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.fir.kt.txt +++ /dev/null @@ -1,32 +0,0 @@ -typealias CT = Cell -typealias CStr = Cell -open class Cell { - constructor(value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: T - field = value - get - -} - -class C1 : Cell { - constructor() /* primary */ { - super/*Cell*/(value = "O") - /* () */ - - } - -} - -class C2 : Cell { - constructor() /* primary */ { - super/*Cell*/(value = "K") - /* () */ - - } - -} diff --git a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt index c5be7be7977..836df3b429a 100644 --- a/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt +++ b/compiler/testData/ir/irText/classes/delegatingConstructorCallToTypeAliasConstructor.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL open class Cell(val value: T) typealias CT = Cell diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt index fd8a6bac184..7e3c918e106 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.ir.txt @@ -131,6 +131,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestJFoo modality:FINAL visibility:public superTypes:[.IFoo]' + FIELD DELEGATE name:$$delegate_0 type:.JFoo visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .JFoo' type=.JFoo origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestJFoo) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -141,9 +144,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo' type=@[EnhancedNullability] kotlin.String 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:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo @@ -163,6 +163,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK1 modality:FINAL visibility:public superTypes:[.IFoo]' + FIELD DELEGATE name:$$delegate_0 type:.K1 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K1' type=.K1 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK1) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -173,9 +176,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt CALL 'public open fun foo (): @[EnhancedNullability] kotlin.String declared in .JFoo' type=@[EnhancedNullability] kotlin.String 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:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo @@ -195,6 +195,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK2 modality:FINAL visibility:public superTypes:[.IFoo]' + FIELD DELEGATE name:$$delegate_0 type:.K2 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K2' type=.K2 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK2) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -204,9 +207,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt CALL 'public open fun foo (): kotlin.String declared in .K2' type=kotlin.String 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:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo @@ -226,6 +226,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK3 modality:FINAL visibility:public superTypes:[.IFoo]' + FIELD DELEGATE name:$$delegate_0 type:.K3 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K3' type=.K3 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK3) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -235,9 +238,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt CALL 'public open fun foo (): kotlin.String declared in .K3' type=kotlin.String 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:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo @@ -257,6 +257,9 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:TestK4 modality:FINAL visibility:public superTypes:[.IFoo]' + FIELD DELEGATE name:$$delegate_0 type:.K4 visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .K4' type=.K4 origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.TestK4) returnType:kotlin.String overridden: public abstract fun foo (): kotlin.String declared in .IFoo @@ -267,9 +270,6 @@ FILE fqName: fileName:/implicitNotNullOnDelegatedImplementation.kt CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .K4' type=@[FlexibleNullability] kotlin.String? 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:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () 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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo diff --git a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt index 335c9527e7c..e2d1ca61d26 100644 --- a/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt +++ b/compiler/testData/ir/irText/classes/implicitNotNullOnDelegatedImplementation.fir.kt.txt @@ -54,12 +54,11 @@ class TestJFoo : IFoo { } + private /* final field */ val $$delegate_0: JFoo = JFoo() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } - private /* final field */ val $$delegate_0: JFoo = JFoo() - } class TestK1 : IFoo { @@ -69,12 +68,11 @@ class TestK1 : IFoo { } + private /* final field */ val $$delegate_0: K1 = K1() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } - private /* final field */ val $$delegate_0: K1 = K1() - } class TestK2 : IFoo { @@ -84,12 +82,11 @@ class TestK2 : IFoo { } + private /* final field */ val $$delegate_0: K2 = K2() override fun foo(): String { return .#$$delegate_0.foo() } - private /* final field */ val $$delegate_0: K2 = K2() - } class TestK3 : IFoo { @@ -99,12 +96,11 @@ class TestK3 : IFoo { } + private /* final field */ val $$delegate_0: K3 = K3() override fun foo(): String { return .#$$delegate_0.foo() } - private /* final field */ val $$delegate_0: K3 = K3() - } class TestK4 : IFoo { @@ -114,11 +110,10 @@ class TestK4 : IFoo { } + private /* final field */ val $$delegate_0: K4 = K4() override fun foo(): String { return .#$$delegate_0.foo() /*!! String */ } - 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 9e9249b2052..074c173a936 100644 --- a/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt +++ b/compiler/testData/ir/irText/classes/kt45934.fir.ir.txt @@ -6,6 +6,9 @@ FILE fqName: fileName:/kt45934.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.I]' + FIELD DELEGATE name:$$delegate_0 type:.J visibility:private [final] + EXPRESSION_BODY + GET_VAR 'client: .J declared in .C.' type=.J origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN ($this:.C) returnType:@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[FlexibleNullability] C of .C.foo?>? overridden: public abstract fun foo (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[FlexibleNullability] C of .I.foo?>? declared in .I @@ -16,9 +19,6 @@ FILE fqName: fileName:/kt45934.kt CALL 'public open fun foo (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[FlexibleNullability] kotlin.String?>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableList<@[FlexibleNullability] kotlin.String?>? 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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .I 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 28e44ffd587..b4c3f5e4f0a 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.ir.txt @@ -62,6 +62,9 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DFoo modality:FINAL visibility:public superTypes:[.IFoo]' + FIELD DELEGATE name:$$delegate_0 type:.IFoo visibility:private [final] + EXPRESSION_BODY + GET_VAR 'd: .IFoo declared in .DFoo.' type=.IFoo origin=null FUN DELEGATED_MEMBER name:testFun visibility:public modality:OPEN <> ($this:.DFoo) returnType:kotlin.Unit annotations: Ann @@ -112,9 +115,6 @@ FILE fqName: fileName:/annotationsOnDelegatedMembers.kt $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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo 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 124df8b21e2..9041f2b8f6a 100644 --- a/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/annotations/annotationsOnDelegatedMembers.fir.kt.txt @@ -31,6 +31,7 @@ class DFoo : IFoo { } + private /* final field */ val $$delegate_0: IFoo = d @Ann override fun testFun() { .#$$delegate_0.testFun() @@ -51,6 +52,5 @@ class DFoo : IFoo { return (.#$$delegate_0, ).() } - 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 deleted file mode 100644 index c39716a2676..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.ir.txt +++ /dev/null @@ -1,168 +0,0 @@ -FILE fqName: fileName:/inheritingDeprecation.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - PROPERTY name:prop visibility:public modality:OPEN [val] - annotations: - Deprecated(message = '', replaceWith = , level = ) - FUN name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String - correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.IFoo - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' - CONST String type=kotlin.String value="" - PROPERTY name:extProp visibility:public modality:OPEN [val] - annotations: - Deprecated(message = '', replaceWith = , level = ) - FUN name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY name:extProp visibility:public modality:OPEN [val] - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .IFoo' - CONST String type=kotlin.String value="" - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated - CONSTRUCTOR visibility:public <> (foo:.IFoo) returnType:.Delegated [primary] - VALUE_PARAMETER name:foo index:0 type:.IFoo - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo]' - PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] - overridden: - public open prop: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:prop visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.Delegated - 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: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] - overridden: - public open extProp: kotlin.String - FUN DELEGATED_MEMBER name: visibility:public modality:OPEN <> ($this:.Delegated, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY DELEGATED_MEMBER name:extProp visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.Delegated - $receiver: VALUE_PARAMETER name: type:kotlin.String - 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: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: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] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.DefaultImpl - CONSTRUCTOR visibility:public <> () returnType:.DefaultImpl [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DefaultImpl modality:FINAL visibility:public superTypes:[.IFoo]' - PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] - annotations: - Deprecated(message = '', replaceWith = , level = ) - overridden: - public open prop: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:prop visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo - PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] - annotations: - Deprecated(message = '', replaceWith = , level = ) - overridden: - public open extProp: kotlin.String - FUN FAKE_OVERRIDE name: visibility:public modality:OPEN <> ($this:.IFoo, $receiver:kotlin.String) returnType:kotlin.String [fake_override] - correspondingProperty: PROPERTY FAKE_OVERRIDE name:extProp visibility:public modality:OPEN [fake_override,val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.IFoo - $receiver: VALUE_PARAMETER name: type:kotlin.String - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.ExplicitOverride - CONSTRUCTOR visibility:public <> () returnType:.ExplicitOverride [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ExplicitOverride modality:FINAL visibility:public superTypes:[.IFoo]' - PROPERTY name:prop visibility:public modality:OPEN [val] - overridden: - public open prop: kotlin.String - FUN name: visibility:public modality:OPEN <> ($this:.ExplicitOverride) returnType:kotlin.String - correspondingProperty: PROPERTY name:prop visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.ExplicitOverride - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ExplicitOverride' - CONST String type=kotlin.String value="" - PROPERTY name:extProp visibility:public modality:OPEN [val] - overridden: - public open extProp: kotlin.String - FUN name: visibility:public modality:OPEN <> ($this:.ExplicitOverride, $receiver:kotlin.String) returnType:kotlin.String - correspondingProperty: PROPERTY name:extProp visibility:public modality:OPEN [val] - overridden: - public open fun (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.ExplicitOverride - $receiver: VALUE_PARAMETER name: type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun (): kotlin.String declared in .ExplicitOverride' - CONST String type=kotlin.String value="" - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt deleted file mode 100644 index ab1d2bac059..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.fir.kt.txt +++ /dev/null @@ -1,63 +0,0 @@ -interface IFoo { - @Deprecated(message = "") - val prop: String - get(): String { - return "" - } - - @Deprecated(message = "") - val String.extProp: String - get(): String { - return "" - } - -} - -class Delegated : IFoo { - constructor(foo: IFoo) /* primary */ { - super/*Any*/() - /* () */ - - } - - override val prop: String - override get(): String { - return .#$$delegate_0.() - } - - override val String.extProp: String - override get(): String { - return (.#$$delegate_0, ).() - } - - private /* final field */ val $$delegate_0: IFoo = foo - -} - -class DefaultImpl : IFoo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class ExplicitOverride : IFoo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override val prop: String - override get(): String { - return "" - } - - override val String.extProp: String - override get(): String { - return "" - } - -} diff --git a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt index 71becc0f543..3e45289ba48 100644 --- a/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt +++ b/compiler/testData/ir/irText/declarations/annotations/inheritingDeprecation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface IFoo { @Deprecated("") val prop: String get() = "" diff --git a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.ir.txt b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.ir.txt deleted file mode 100644 index 912b1941705..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.ir.txt +++ /dev/null @@ -1,37 +0,0 @@ -FILE fqName: fileName:/typeAliasesWithAnnotations.kt - TYPEALIAS name:TestTypeAlias visibility:public expandedType:kotlin.String - annotations: - TestAnn(x = 'TestTypeAlias') - CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPEALIAS' type=kotlin.annotation.AnnotationTarget]) - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.TestAnn - CONSTRUCTOR visibility:public <> (x:kotlin.String) returnType:.TestAnn [primary] - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:TestAnn modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: kotlin.String declared in .TestAnn.' type=kotlin.String origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.TestAnn) returnType:kotlin.String - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.TestAnn - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.String declared in .TestAnn' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:kotlin.String visibility:private [final]' type=kotlin.String origin=null - receiver: GET_VAR ': .TestAnn declared in .TestAnn.' type=.TestAnn origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.kt.txt b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.kt.txt deleted file mode 100644 index db1f22605f7..00000000000 --- a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.fir.kt.txt +++ /dev/null @@ -1,15 +0,0 @@ -@TestAnn(x = "TestTypeAlias") -typealias TestTypeAlias = String -@Target(allowedTargets = [AnnotationTarget.TYPEALIAS]) -open annotation class TestAnn : Annotation { - constructor(x: String) /* primary */ { - super/*Any*/() - /* () */ - - } - - val x: String - field = x - get - -} diff --git a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt index 9a9220cc5ad..4c504a07fe2 100644 --- a/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt +++ b/compiler/testData/ir/irText/declarations/annotations/typeAliasesWithAnnotations.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL @Target(AnnotationTarget.TYPEALIAS) annotation class TestAnn(val x: String) diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt index 84a50a5d160..60f0e967be4 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.ir.txt @@ -116,6 +116,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base]' + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -127,9 +130,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ @@ -158,6 +158,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase]' + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -169,9 +172,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder1.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt index ed390a4a4c8..e897435f63b 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder1.fir.kt.txt @@ -52,11 +52,11 @@ class Derived : DerivedBase, Base { } + private /* final field */ val $$delegate_0: Base = newBase() override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } - private /* final field */ val $$delegate_0: Base = newBase() init { ( = ().plus(other = ":Derived")) } @@ -70,11 +70,11 @@ class Derived1 : Base, DerivedBase { } + private /* final field */ val $$delegate_0: Base = newBase() override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } - private /* final field */ val $$delegate_0: Base = newBase() init { ( = ().plus(other = ":Derived")) } diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt index 51e5d154df5..19c9409f4b7 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.ir.txt @@ -187,6 +187,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[foo.DerivedBase; foo.Base; foo.Base2]' + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -198,9 +201,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived declared in foo.Derived.foo' type=foo.Derived origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -212,9 +215,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived declared in foo.Derived.bar' type=foo.Derived origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived.bar' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ @@ -246,6 +246,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived1 modality:FINAL visibility:public superTypes:[foo.Base; foo.DerivedBase; foo.Base2]' + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -257,9 +260,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.foo' type=foo.Derived1 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived1.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived1, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -271,9 +274,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived1 declared in foo.Derived1.bar' type=foo.Derived1 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived1.bar' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ @@ -305,6 +305,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in foo.DerivedBase' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived2 modality:FINAL visibility:public superTypes:[foo.Base; foo.Base2; foo.DerivedBase]' + FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + EXPRESSION_BODY + CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun foo (x: kotlin.String): kotlin.String declared in foo.Base @@ -316,9 +319,9 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final]' type=foo.Base origin=null receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.foo' type=foo.Derived2 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived2.foo' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_0 type:foo.Base visibility:private [final] + FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] EXPRESSION_BODY - CALL 'public final fun newBase (): foo.Base declared in foo' type=foo.Base origin=null + CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:foo.Derived2, x:kotlin.String) returnType:kotlin.String overridden: public abstract fun bar (x: kotlin.String): kotlin.String declared in foo.Base2 @@ -330,9 +333,6 @@ FILE fqName:foo fileName:/delegationEvaluationOrder2.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final]' type=foo.Base2 origin=null receiver: GET_VAR ': foo.Derived2 declared in foo.Derived2.bar' type=foo.Derived2 origin=null x: GET_VAR 'x: kotlin.String declared in foo.Derived2.bar' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_1 type:foo.Base2 visibility:private [final] - EXPRESSION_BODY - CALL 'public final fun newBase2 (): foo.Base2 declared in foo' type=foo.Base2 origin=null ANONYMOUS_INITIALIZER isStatic=false BLOCK_BODY CALL 'public final fun (: kotlin.String): kotlin.Unit declared in foo' type=kotlin.Unit origin=EQ diff --git a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt index 2e2475248a0..5c892e4c18d 100644 --- a/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/delegate/delegationEvaluationOrder2.fir.kt.txt @@ -79,16 +79,16 @@ class Derived : DerivedBase, Base, Base2 { } + private /* final field */ val $$delegate_0: Base = newBase() override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } - private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() override fun bar(x: String): String { return .#$$delegate_1.bar(x = x) } - private /* final field */ val $$delegate_1: Base2 = newBase2() init { ( = ().plus(other = ":Derived")) } @@ -102,16 +102,16 @@ class Derived1 : Base, DerivedBase, Base2 { } + private /* final field */ val $$delegate_0: Base = newBase() override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } - private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() override fun bar(x: String): String { return .#$$delegate_1.bar(x = x) } - private /* final field */ val $$delegate_1: Base2 = newBase2() init { ( = ().plus(other = ":Derived")) } @@ -125,16 +125,16 @@ class Derived2 : Base, Base2, DerivedBase { } + private /* final field */ val $$delegate_0: Base = newBase() override fun foo(x: String): String { return .#$$delegate_0.foo(x = x) } - private /* final field */ val $$delegate_0: Base = newBase() + private /* final field */ val $$delegate_1: Base2 = newBase2() override fun bar(x: String): String { return .#$$delegate_1.bar(x = x) } - private /* final field */ val $$delegate_1: Base2 = newBase2() init { ( = ().plus(other = ":Derived")) } diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt index 3058197511c..51361b971cd 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.ir.txt @@ -30,6 +30,9 @@ FILE fqName: fileName:/kt35550.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[.I]' + FIELD DELEGATE name:$$delegate_0 type:.I visibility:private [final] + EXPRESSION_BODY + GET_VAR 'i: .I declared in .A.' type=.I origin=null PROPERTY DELEGATED_MEMBER name:id visibility:public modality:OPEN [val] overridden: public open id: T of .I. @@ -47,9 +50,6 @@ FILE fqName: fileName:/kt35550.kt $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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .I diff --git a/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt index 3462ff3425e..53a0d3d66f3 100644 --- a/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/kt35550.fir.kt.txt @@ -13,11 +13,10 @@ class A : I { } + private /* final field */ val $$delegate_0: I = i override val T.id: T override get(): T { return (.#$$delegate_0, ).() } - private /* final field */ val $$delegate_0: I = i - } diff --git a/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt b/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt deleted file mode 100644 index 58442d73d97..00000000000 --- a/compiler/testData/ir/irText/declarations/kt52677.fir.ir.txt +++ /dev/null @@ -1,186 +0,0 @@ -FILE fqName: fileName:/kt52677.kt - TYPEALIAS name:Uuid visibility:public expandedType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - CLASS ANNOTATION_CLASS name:MySerializable modality:OPEN visibility:public superTypes:[kotlin.Annotation] - annotations: - Target(allowedTargets = [GET_ENUM 'ENUM_ENTRY IR_EXTERNAL_DECLARATION_STUB name:TYPE' type=kotlin.annotation.AnnotationTarget]) - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MySerializable - CONSTRUCTOR visibility:public <> (c:kotlin.reflect.KClass<*>) returnType:.MySerializable [primary] - VALUE_PARAMETER name:c index:0 type:kotlin.reflect.KClass<*> - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS ANNOTATION_CLASS name:MySerializable modality:OPEN visibility:public superTypes:[kotlin.Annotation]' - PROPERTY name:c visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.reflect.KClass<*> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'c: kotlin.reflect.KClass<*> declared in .MySerializable.' type=kotlin.reflect.KClass<*> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.MySerializable) returnType:kotlin.reflect.KClass<*> - correspondingProperty: PROPERTY name:c visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.MySerializable - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.reflect.KClass<*> declared in .MySerializable' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:c type:kotlin.reflect.KClass<*> visibility:private [final]' type=kotlin.reflect.KClass<*> origin=null - receiver: GET_VAR ': .MySerializable declared in .MySerializable.' type=.MySerializable origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Annotation - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:LoginSuccessPacket modality:FINAL visibility:public [data] superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.LoginSuccessPacket - CONSTRUCTOR visibility:public <> (id:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1) returnType:.LoginSuccessPacket [primary] - VALUE_PARAMETER name:id index:0 type:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:LoginSuccessPacket modality:FINAL visibility:public [data] superTypes:[kotlin.Any]' - PROPERTY name:id visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 visibility:private [final] - EXPRESSION_BODY - GET_VAR 'id: @[MySerializable(c = ...)] .Uuid1 declared in .LoginSuccessPacket.' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.LoginSuccessPacket) returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - correspondingProperty: PROPERTY name:id visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): @[MySerializable(c = ...)] .Uuid1 declared in .LoginSuccessPacket' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.' type=.LoginSuccessPacket origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.LoginSuccessPacket) returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 [operator] - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun component1 (): @[MySerializable(c = ...)] .Uuid1 declared in .LoginSuccessPacket' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.component1' type=.LoginSuccessPacket origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:copy visibility:public modality:FINAL <> ($this:.LoginSuccessPacket, id:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1) returnType:.LoginSuccessPacket - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - VALUE_PARAMETER name:id index:0 type:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - EXPRESSION_BODY - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.copy' type=.LoginSuccessPacket origin=null - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun copy (id: @[MySerializable(c = ...)] .Uuid1): .LoginSuccessPacket declared in .LoginSuccessPacket' - CONSTRUCTOR_CALL 'public constructor (id: @[MySerializable(c = ...)] .Uuid1) declared in .LoginSuccessPacket' type=.LoginSuccessPacket origin=null - id: GET_VAR 'id: @[MySerializable(c = ...)] .Uuid1 declared in .LoginSuccessPacket.copy' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:toString visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.String - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun toString (): kotlin.String declared in .LoginSuccessPacket' - STRING_CONCATENATION type=kotlin.String - CONST String type=kotlin.String value="LoginSuccessPacket(" - CONST String type=kotlin.String value="id=" - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.toString' type=.LoginSuccessPacket origin=null - CONST String type=kotlin.String value=")" - FUN GENERATED_DATA_CLASS_MEMBER name:hashCode visibility:public modality:OPEN <> ($this:.LoginSuccessPacket) returnType:kotlin.Int - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun hashCode (): kotlin.Int declared in .LoginSuccessPacket' - CALL 'public open fun hashCode (): kotlin.Int declared in .Uuid1' type=kotlin.Int origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.hashCode' type=.LoginSuccessPacket origin=null - FUN GENERATED_DATA_CLASS_MEMBER name:equals visibility:public modality:OPEN <> ($this:.LoginSuccessPacket, other:kotlin.Any?) returnType:kotlin.Boolean [operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:.LoginSuccessPacket - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - BLOCK_BODY - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun EQEQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EQEQEQ - arg0: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.equals' type=.LoginSuccessPacket origin=null - arg1: GET_VAR 'other: kotlin.Any? declared in .LoginSuccessPacket.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' - CONST Boolean type=kotlin.Boolean value=true - WHEN type=kotlin.Unit origin=null - BRANCH - if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=.LoginSuccessPacket - GET_VAR 'other: kotlin.Any? declared in .LoginSuccessPacket.equals' type=kotlin.Any? origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' - CONST Boolean type=kotlin.Boolean value=false - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.LoginSuccessPacket [val] - TYPE_OP type=.LoginSuccessPacket origin=CAST typeOperand=.LoginSuccessPacket - GET_VAR 'other: kotlin.Any? declared in .LoginSuccessPacket.equals' type=kotlin.Any? origin=null - WHEN type=kotlin.Unit origin=null - BRANCH - if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ - $this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ - arg0: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR ': .LoginSuccessPacket declared in .LoginSuccessPacket.equals' type=.LoginSuccessPacket origin=null - arg1: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:id type:@[MySerializable(c = ...)] .Uuid1 visibility:private [final]' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null - receiver: GET_VAR 'val tmp_0: .LoginSuccessPacket declared in .LoginSuccessPacket.equals' type=.LoginSuccessPacket origin=null - then: RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' - CONST Boolean type=kotlin.Boolean value=false - RETURN type=kotlin.Nothing from='public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .LoginSuccessPacket' - CONST Boolean type=kotlin.Boolean value=true - CLASS INTERFACE name:MySerializer modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.MySerializer.MySerializer> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1>] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.UuidSerializer - CONSTRUCTOR visibility:private <> () returnType:.UuidSerializer [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .MySerializer - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .MySerializer - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .MySerializer - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Uuid1 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Uuid1 - CONSTRUCTOR visibility:public <> () returnType:.Uuid1 [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Uuid1 modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> () returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - BLOCK_BODY - THROW type=kotlin.Nothing - CONSTRUCTOR_CALL 'public constructor () declared in java.lang.RuntimeException' type=java.lang.RuntimeException origin=null - FUN name:bar visibility:public modality:FINAL <> () returnType:@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun bar (): @[MySerializable(c = ...)] .Uuid1 declared in ' - CALL 'public final fun foo (): @[MySerializable(c = ...)] .Uuid1 declared in ' type=@[MySerializable(c = CLASS_REFERENCE 'CLASS OBJECT name:UuidSerializer modality:FINAL visibility:public superTypes:[.MySerializer<@[MySerializable(c = ...)] .Uuid1>]' type=kotlin.reflect.KClass<.UuidSerializer>)] .Uuid1 origin=null diff --git a/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt b/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt deleted file mode 100644 index 3d0b6cde922..00000000000 --- a/compiler/testData/ir/irText/declarations/kt52677.fir.kt.txt +++ /dev/null @@ -1,88 +0,0 @@ -typealias Uuid = @MySerializable(c = UuidSerializer::class) Uuid1 -@Target(allowedTargets = [AnnotationTarget.TYPE]) -open annotation class MySerializable : Annotation { - constructor(c: KClass<*>) /* primary */ { - super/*Any*/() - /* () */ - - } - - val c: KClass<*> - field = c - get - -} - -data class LoginSuccessPacket { - constructor(id: @MySerializable(c = UuidSerializer::class) Uuid1) /* primary */ { - super/*Any*/() - /* () */ - - } - - val id: @MySerializable(c = UuidSerializer::class) Uuid1 - field = id - get - - operator fun component1(): @MySerializable(c = UuidSerializer::class) Uuid1 { - return .#id - } - - fun copy(id: @MySerializable(c = UuidSerializer::class) Uuid1 = .#id): LoginSuccessPacket { - return LoginSuccessPacket(id = id) - } - - override fun toString(): String { - return "LoginSuccessPacket(" + "id=" + .#id + ")" - } - - override fun hashCode(): Int { - return .#id.hashCode() - } - - override operator fun equals(other: Any?): Boolean { - when { - EQEQEQ(arg0 = , arg1 = other) -> return true - } - when { - other !is LoginSuccessPacket -> return false - } - val tmp_0: LoginSuccessPacket = other as LoginSuccessPacket - when { - EQEQ(arg0 = .#id, arg1 = tmp_0.#id).not() -> return false - } - return true - } - -} - -interface MySerializer { - -} - -object UuidSerializer : MySerializer<@MySerializable(c = UuidSerializer::class) Uuid1> { - private constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class Uuid1 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -fun foo(): @MySerializable(c = UuidSerializer::class) Uuid1 { - throw RuntimeException() -} - -fun bar(): @MySerializable(c = UuidSerializer::class) Uuid1 { - return foo() -} - diff --git a/compiler/testData/ir/irText/declarations/kt52677.kt b/compiler/testData/ir/irText/declarations/kt52677.kt index 9f800b3386e..0ee694a5429 100644 --- a/compiler/testData/ir/irText/declarations/kt52677.kt +++ b/compiler/testData/ir/irText/declarations/kt52677.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // ISSUE: KT-52677 // IGNORE_BACKEND: JS_IR // IGNORE_BACKEND: JS_IR_ES6 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 c8ce07ea029..e600f60b9f1 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.ir.txt @@ -35,6 +35,9 @@ FILE fqName: fileName:/delegatedMembers.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Test modality:FINAL visibility:public superTypes:[.IBase.Test>]' + 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 DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Test.Test>, x:kotlin.Int) returnType:kotlin.Unit overridden: public abstract fun foo (x: kotlin.Int): kotlin.Unit declared in .IBase @@ -72,9 +75,6 @@ FILE fqName: fileName:/delegatedMembers.kt CALL 'public abstract fun (): kotlin.Int declared in .IBase' type=kotlin.Int origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.IBase.Test> visibility: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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IBase 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 5298e6d7e41..9ad1b4ff8af 100644 --- a/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt +++ b/compiler/testData/ir/irText/declarations/parameters/delegatedMembers.fir.kt.txt @@ -15,6 +15,7 @@ class Test : IBase { } + private /* final field */ val $$delegate_0: IBase = impl override fun foo(x: Int) { .#$$delegate_0.foo(x = x) } @@ -28,6 +29,5 @@ class Test : IBase { return .#$$delegate_0.() } - private /* final field */ val $$delegate_0: IBase = impl - } + diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt index 6904b0e25b7..5fe6fcf6698 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.ir.txt @@ -1,7 +1,4 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt - TYPEALIAS name:KR visibility:public expandedType:.KRunnable - TYPEALIAS name:KSS visibility:public expandedType:.KSupplier - TYPEALIAS name:KCS visibility:public expandedType:.KConsumer CLASS INTERFACE name:KRunnable modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KRunnable FUN name:run visibility:public modality:ABSTRACT <> ($this:.KRunnable) returnType:kotlin.Unit @@ -19,6 +16,7 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:KR visibility:public expandedType:.KRunnable CLASS INTERFACE name:KSupplier modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KSupplier.KSupplier> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -37,6 +35,7 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:KSS visibility:public expandedType:.KSupplier CLASS INTERFACE name:KConsumer modality:ABSTRACT visibility:public [fun] superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.KConsumer.KConsumer> TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false @@ -56,6 +55,7 @@ FILE fqName: fileName:/funInterfaceConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:KCS visibility:public expandedType:.KConsumer FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.reflect.KFunction1, .KRunnable> BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test1 (): kotlin.reflect.KFunction1, .KRunnable> declared in ' diff --git a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt index 7a5ee4fe1a0..6f9c39f4d05 100644 --- a/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/funInterfaceConstructorReference.fir.kt.txt @@ -1,21 +1,21 @@ -typealias KR = KRunnable -typealias KSS = KSupplier -typealias KCS = KConsumer fun interface KRunnable { abstract fun run() } +typealias KR = KRunnable fun interface KSupplier { abstract fun get(): T } +typealias KSS = KSupplier fun interface KConsumer { abstract fun accept(x: T) } +typealias KCS = KConsumer fun test1(): KFunction1, KRunnable> { return { // BLOCK local fun KRunnable(function: Function0): KRunnable { diff --git a/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt b/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt index 59f481411a2..ec175a09f12 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.fir.ir.txt @@ -1,5 +1,4 @@ FILE fqName: fileName:/kt16905.kt - TYPEALIAS name:OI visibility:public expandedType:.Outer.Inner CLASS CLASS name:Outer modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Outer CONSTRUCTOR visibility:public <> () returnType:.Outer [primary] @@ -81,6 +80,7 @@ FILE fqName: fileName:/kt16905.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:OI visibility:public expandedType:.Outer.Inner FUN name:test visibility:public modality:FINAL <> () returnType:.Outer.Inner BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun test (): .Outer.Inner declared in ' diff --git a/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt b/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt index a183fef06e5..5f5268b994e 100644 --- a/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/kt16905.fir.kt.txt @@ -1,4 +1,3 @@ -typealias OI = Inner class Outer { constructor() /* primary */ { super/*Any*/() @@ -35,6 +34,7 @@ class Outer { } +typealias OI = Inner fun test(): Inner { return Outer().Inner() } diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.ir.txt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.ir.txt deleted file mode 100644 index 0ea7e97cbf1..00000000000 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.ir.txt +++ /dev/null @@ -1,40 +0,0 @@ -FILE fqName: fileName:/specializedTypeAliasConstructorCall.kt - TYPEALIAS name:IntAlias visibility:public expandedType:.Cell - CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Cell.Cell> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (value:T of .Cell) returnType:.Cell.Cell> [primary] - VALUE_PARAMETER name:value index:0 type:T of .Cell - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Cell modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: T of .Cell declared in .Cell.' type=T of .Cell origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.Cell.Cell>) returnType:T of .Cell - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Cell.Cell> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T of .Cell declared in .Cell' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:T of .Cell visibility:private [final]' type=T of .Cell origin=null - receiver: GET_VAR ': .Cell.Cell> declared in .Cell.' type=.Cell.Cell> origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:test visibility:public modality:FINAL <> () returnType:.Cell - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun test (): .Cell declared in ' - CONSTRUCTOR_CALL 'public constructor (value: T of .Cell) declared in .Cell' type=.Cell origin=null - : kotlin.Int - value: CONST Int type=kotlin.Int value=42 diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.kt.txt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.kt.txt deleted file mode 100644 index ca9d4279e1d..00000000000 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.fir.kt.txt +++ /dev/null @@ -1,17 +0,0 @@ -typealias IntAlias = Cell -class Cell { - constructor(value: T) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: T - field = value - get - -} - -fun test(): Cell { - return Cell(value = 42) -} diff --git a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt index 57c0329224f..5343c881cc9 100644 --- a/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt +++ b/compiler/testData/ir/irText/expressions/specializedTypeAliasConstructorCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class Cell(val value: T) typealias IntAlias = Cell diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt index 01b477f4ea3..7006243cd6a 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.ir.txt @@ -1,6 +1,4 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt - TYPEALIAS name:CA visibility:public expandedType:.C - TYPEALIAS name:NA visibility:public expandedType:.Host.Nested CLASS CLASS name:C modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C CONSTRUCTOR visibility:public <> (x:kotlin.Int) returnType:.C [primary] @@ -21,6 +19,7 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:CA visibility:public expandedType:.C CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Host CONSTRUCTOR visibility:private <> () returnType:.Host [primary] @@ -60,6 +59,7 @@ FILE fqName: fileName:/typeAliasConstructorReference.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any + TYPEALIAS name:NA visibility:public expandedType:.Host.Nested PROPERTY name:test1 visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:test1 type:kotlin.Function1.C> visibility:private [final,static] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt index 9dec7e45903..b73db21ba5a 100644 --- a/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt +++ b/compiler/testData/ir/irText/expressions/typeAliasConstructorReference.fir.kt.txt @@ -1,5 +1,3 @@ -typealias CA = C -typealias NA = Nested class C { constructor(x: Int) /* primary */ { super/*Any*/() @@ -9,6 +7,7 @@ class C { } +typealias CA = C object Host { private constructor() /* primary */ { super/*Any*/() @@ -27,6 +26,7 @@ object Host { } +typealias NA = Nested val test1: Function1 field = C:: get diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt index 4adfb83fffa..1c438252441 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.ir.txt @@ -108,6 +108,9 @@ FILE fqName: fileName:/AnnotationLoader.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Visitor]' + FIELD DELEGATE name:$$delegate_0 type:.Visitor visibility:private [final] + EXPRESSION_BODY + GET_VAR 'val visitor: .Visitor declared in .AnnotationLoader.loadAnnotation..visitAnnotation' type=.Visitor origin=null FUN DELEGATED_MEMBER name:visitArray visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:.Visitor? overridden: public open fun visitArray (): .Visitor? declared in .Visitor @@ -126,9 +129,6 @@ FILE fqName: fileName:/AnnotationLoader.kt CALL 'public open fun visitAnnotation (): .Visitor? declared in .Visitor' 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:private [final] - EXPRESSION_BODY - GET_VAR 'val visitor: .Visitor declared in .AnnotationLoader.loadAnnotation..visitAnnotation' type=.Visitor origin=null FUN name:visit visibility:public modality:OPEN <> ($this:.AnnotationLoader.loadAnnotation..visitAnnotation.) returnType:kotlin.Unit overridden: public abstract fun visit (): kotlin.Unit declared in .Visitor diff --git a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt index e58def6a82b..c37f2dd9dac 100644 --- a/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/AnnotationLoader.fir.kt.txt @@ -59,6 +59,7 @@ class AnnotationLoader { } + private /* final field */ val $$delegate_0: Visitor = visitor override fun visitArray(): Visitor? { return .#$$delegate_0.visitArray() } @@ -67,7 +68,6 @@ class AnnotationLoader { return .#$$delegate_0.visitAnnotation() } - private /* final field */ val $$delegate_0: Visitor = visitor override fun visit() { } @@ -87,3 +87,4 @@ class AnnotationLoader { } } + diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt index cbc0b6cabcf..33f4ec4aba2 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.ir.txt @@ -6,6 +6,9 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Impl modality:FINAL visibility:public superTypes:[.Foo.A; .Foo.B]' + 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 DELEGATED_MEMBER name:add visibility:public modality:OPEN <> ($this:.Impl, element:@[FlexibleNullability] kotlin.String?) returnType:kotlin.Boolean overridden: public abstract fun add (element: @[FlexibleNullability] kotlin.String?): kotlin.Boolean declared in .Foo.A @@ -134,9 +137,6 @@ FILE fqName: fileName:/DelegationAndInheritanceFromJava.kt CALL 'public abstract fun (): kotlin.Int declared in kotlin.collections.Set' type=kotlin.Int 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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Foo.A diff --git a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt index 2d8c9fc9565..66552866d53 100644 --- a/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/DelegationAndInheritanceFromJava.fir.kt.txt @@ -5,6 +5,7 @@ class Impl : A, B { } + private /* final field */ val $$delegate_0: B = b override fun add(element: @FlexibleNullability String?): Boolean { return .#$$delegate_0.add(element = element) } @@ -50,10 +51,9 @@ class Impl : A, B { return .#$$delegate_0.() } - private /* final field */ val $$delegate_0: B = b - } fun box(): String { return "OK" } + diff --git a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.ir.txt b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.ir.txt deleted file mode 100644 index 1ece81a4483..00000000000 --- a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.ir.txt +++ /dev/null @@ -1,90 +0,0 @@ -FILE fqName: fileName:/ErrorInDefaultValue.kt - CLASS INTERFACE name:A modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A - FUN name:f visibility:public modality:ABSTRACT <> ($this:.A, x:kotlin.String) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.A - VALUE_PARAMETER name:x index:0 type:kotlin.String - EXPRESSION_BODY - CONST String type=kotlin.String value="OK" - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.B - CONSTRUCTOR visibility:public <> () returnType:.B [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:FINAL visibility:public superTypes:[.A]' - FUN name:f visibility:public modality:OPEN <> ($this:.B, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun f (x: kotlin.String): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.B - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun f (x: kotlin.String): kotlin.String declared in .B' - GET_VAR 'x: kotlin.String declared in .B.f' type=kotlin.String origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (x:.A) returnType:.C [primary] - VALUE_PARAMETER name:x index:0 type:.A - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.A]' - FUN DELEGATED_MEMBER name:f visibility:public modality:OPEN <> ($this:.C, x:kotlin.String) returnType:kotlin.String - overridden: - public abstract fun f (x: kotlin.String): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:x index:0 type:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun f (x: kotlin.String): kotlin.String declared in .C' - CALL 'public abstract fun f (x: kotlin.String): kotlin.String declared in .A' type=kotlin.String origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.A visibility:private [final]' type=.A origin=null - receiver: GET_VAR ': .C declared in .C.f' type=.C origin=null - x: GET_VAR 'x: kotlin.String declared in .C.f' type=kotlin.String origin=null - PROPERTY name:x visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:x type:.A visibility:private [final] - EXPRESSION_BODY - GET_VAR 'x: .A declared in .C.' type=.A origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.C) returnType:.A - correspondingProperty: PROPERTY name:x visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .A declared in .C' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:x type:.A visibility:private [final]' type=.A origin=null - receiver: GET_VAR ': .C declared in .C.' type=.C origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .A - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.kt.txt b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.kt.txt deleted file mode 100644 index c30c6e58fcd..00000000000 --- a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.fir.kt.txt +++ /dev/null @@ -1,34 +0,0 @@ -interface A { - abstract fun f(x: String = "OK"): String - -} - -class B : A { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun f(x: String): String { - return x - } - -} - -class C : A { - constructor(x: A) /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun f(x: String): String { - return .#x.f(x = x) - } - - val x: A - field = x - get - -} diff --git a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt index 1ff793d939b..9060270a15f 100644 --- a/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt +++ b/compiler/testData/ir/irText/firProblems/ErrorInDefaultValue.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface A { fun f(x: String = "OK"): String } diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt index 3a40a6f2890..82b0e279d47 100644 --- a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.ir.txt @@ -54,6 +54,10 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name: modality:FINAL visibility:local superTypes:[.Bar]' + FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final] + EXPRESSION_BODY + CALL 'private final fun (): .Wrapper.dummy. declared in .Wrapper' type=.Wrapper.dummy. origin=GET_PROPERTY + $this: GET_VAR ': .Wrapper declared in .Wrapper' type=.Wrapper origin=null PROPERTY DELEGATED_MEMBER name:foo visibility:public modality:OPEN [val] overridden: public open foo: kotlin.String @@ -67,10 +71,6 @@ FILE fqName: fileName:/FakeOverrideInAnonymousWithDelegation.kt CALL 'public open fun (): kotlin.String declared in .Bar' type=kotlin.String origin=null $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final]' type=.Wrapper.dummy. origin=null receiver: GET_VAR ': .Wrapper.bar. declared in .Wrapper.bar..' type=.Wrapper.bar. origin=null - FIELD DELEGATE name:$$delegate_0 type:.Wrapper.dummy. visibility:private [final] - EXPRESSION_BODY - CALL 'private final fun (): .Wrapper.dummy. declared in .Wrapper' type=.Wrapper.dummy. origin=GET_PROPERTY - $this: GET_VAR ': .Wrapper declared in .Wrapper' type=.Wrapper origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .Bar diff --git a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt index bce043e7896..ccfb2029f5e 100644 --- a/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/FakeOverrideInAnonymousWithDelegation.fir.kt.txt @@ -29,13 +29,12 @@ class Wrapper { } + private /* final field */ val $$delegate_0: = .() override val foo: String override get(): String { return .#$$delegate_0.() } - private /* final field */ val $$delegate_0: = .() - } () @@ -51,3 +50,4 @@ interface Bar { } } + diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.ir.txt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.ir.txt index 346b62b42c5..20de07cc068 100644 --- a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.ir.txt @@ -116,6 +116,17 @@ FILE fqName: fileName:/Fir2IrClassifierStorage.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Fir2IrClassifierStorage modality:FINAL visibility:public superTypes:[.Fir2IrComponents]' + PROPERTY name:components visibility:private modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final] + EXPRESSION_BODY + GET_VAR 'components: .Fir2IrComponents declared in .Fir2IrClassifierStorage.' type=.Fir2IrComponents origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrComponents + correspondingProperty: PROPERTY name:components visibility:private modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage + BLOCK_BODY + RETURN type=kotlin.Nothing from='private final fun (): .Fir2IrComponents declared in .Fir2IrClassifierStorage' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null + receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null PROPERTY DELEGATED_MEMBER name:session visibility:public modality:OPEN [val] overridden: public abstract session: .FirSession @@ -142,17 +153,6 @@ FILE fqName: fileName:/Fir2IrClassifierStorage.kt CALL 'public abstract fun (): .Fir2IrClassifierStorage declared in .Fir2IrComponents' type=.Fir2IrClassifierStorage origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null - PROPERTY name:components visibility:private modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final] - EXPRESSION_BODY - GET_VAR 'components: .Fir2IrComponents declared in .Fir2IrClassifierStorage.' type=.Fir2IrComponents origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:private modality:FINAL <> ($this:.Fir2IrClassifierStorage) returnType:.Fir2IrComponents - correspondingProperty: PROPERTY name:components visibility:private modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.Fir2IrClassifierStorage - BLOCK_BODY - RETURN type=kotlin.Nothing from='private final fun (): .Fir2IrComponents declared in .Fir2IrClassifierStorage' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:components type:.Fir2IrComponents visibility:private [final]' type=.Fir2IrComponents origin=null - receiver: GET_VAR ': .Fir2IrClassifierStorage declared in .Fir2IrClassifierStorage.' type=.Fir2IrClassifierStorage origin=null PROPERTY name:name visibility:private modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:name type:kotlin.String visibility:private [final] EXPRESSION_BODY diff --git a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.kt.txt b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.kt.txt index 78703019d4a..a8b227edf76 100644 --- a/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/Fir2IrClassifierStorage.fir.kt.txt @@ -44,6 +44,10 @@ class Fir2IrClassifierStorage : Fir2IrComponents { } + private val components: Fir2IrComponents + field = components + private get + override val session: FirSession override get(): FirSession { return .#components.() @@ -54,10 +58,6 @@ class Fir2IrClassifierStorage : Fir2IrComponents { return .#components.() } - private val components: Fir2IrComponents - field = components - private get - private val name: String field = .().() private get diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt index 79a2855789c..a0e1d0e4c15 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.ir.txt @@ -90,15 +90,6 @@ FILE fqName: fileName:/SignatureClash.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DataClass modality:FINAL visibility:public [data] superTypes:[.Derived; .Delegate]' - FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Unit - overridden: - public abstract fun bar (): kotlin.Unit declared in .Derived - public abstract fun bar (): kotlin.Unit declared in .Delegate - $this: VALUE_PARAMETER name: type:.DataClass - BLOCK_BODY - CALL 'public abstract fun bar (): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null - $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null - receiver: GET_VAR ': .DataClass declared in .DataClass.bar' type=.DataClass origin=null PROPERTY name:delegate visibility:public modality:FINAL [val] FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final] EXPRESSION_BODY @@ -110,6 +101,15 @@ FILE fqName: fileName:/SignatureClash.kt RETURN type=kotlin.Nothing from='public final fun (): .Delegate declared in .DataClass' GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null receiver: GET_VAR ': .DataClass declared in .DataClass.' type=.DataClass origin=null + FUN DELEGATED_MEMBER name:bar visibility:public modality:OPEN <> ($this:.DataClass) returnType:kotlin.Unit + overridden: + public abstract fun bar (): kotlin.Unit declared in .Derived + public abstract fun bar (): kotlin.Unit declared in .Delegate + $this: VALUE_PARAMETER name: type:.DataClass + BLOCK_BODY + CALL 'public abstract fun bar (): kotlin.Unit declared in .Delegate' type=kotlin.Unit origin=null + $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:delegate type:.Delegate visibility:private [final]' type=.Delegate origin=null + receiver: GET_VAR ': .DataClass declared in .DataClass.bar' type=.DataClass origin=null FUN GENERATED_DATA_CLASS_MEMBER name:component1 visibility:public modality:FINAL <> ($this:.DataClass) returnType:.Delegate [operator] $this: VALUE_PARAMETER name: type:.DataClass BLOCK_BODY diff --git a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt index 2c5ed10d260..b8ebca548b0 100644 --- a/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/SignatureClash.fir.kt.txt @@ -36,14 +36,14 @@ data class DataClass : Derived, Delegate { } - override fun bar() { - .#delegate.bar() - } - val delegate: Delegate field = delegate get + override fun bar() { + .#delegate.bar() + } + operator fun component1(): Delegate { return .#delegate } diff --git a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.ir.txt b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.ir.txt deleted file mode 100644 index 403bcb3a427..00000000000 --- a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.ir.txt +++ /dev/null @@ -1,148 +0,0 @@ -FILE fqName: fileName:/TypeAliasConstructorParameterMapping.kt - TYPEALIAS name:OneToOne visibility:public expandedType:.Box1.OneToOne> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:OneToTwo visibility:public expandedType:.Box2.OneToTwo, A of .OneToTwo> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwo visibility:public expandedType:.Box2.TwoToTwo, B of .TwoToTwo> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwoReversed visibility:public expandedType:.Box2.TwoToTwoReversed, A of .TwoToTwoReversed> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToOne visibility:public expandedType:.Box1.TwoToOne> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:OneToOneTransitive visibility:public expandedType:.Box1.OneToOneTransitive> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwoTransitive visibility:public expandedType:.Box2.TwoToTwoTransitive, A of .TwoToTwoTransitive> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:TwoToTwoTransitive2 visibility:public expandedType:.Box2.TwoToTwoTransitive2, B of .TwoToTwoTransitive2> - TYPE_PARAMETER name:A index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:B index:1 variance: superTypes:[kotlin.Any?] reified:false - CLASS CLASS name:Box1 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box1.Box1> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Box1.Box1> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box1 modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Box2 modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Box2.Box2, R of .Box2> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPE_PARAMETER name:R index:1 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.Box2.Box2, R of .Box2> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Box2 modality:FINAL visibility:public superTypes:[kotlin.Any]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:test1 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test1 type:.Box1 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box1' type=.Box1 origin=null - : kotlin.Int - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box1 - correspondingProperty: PROPERTY name:test1 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box1 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test1 type:.Box1 visibility:private [final,static]' type=.Box1 origin=null - PROPERTY name:test2 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test2 type:.Box2 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box2' type=.Box2 origin=null - : kotlin.Int - : kotlin.Int - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box2 - correspondingProperty: PROPERTY name:test2 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box2 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test2 type:.Box2 visibility:private [final,static]' type=.Box2 origin=null - PROPERTY name:test3 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test3 type:.Box2 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box2' type=.Box2 origin=null - : kotlin.Int - : kotlin.String - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box2 - correspondingProperty: PROPERTY name:test3 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box2 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test3 type:.Box2 visibility:private [final,static]' type=.Box2 origin=null - PROPERTY name:test4 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test4 type:.Box2 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box2' type=.Box2 origin=null - : kotlin.String - : kotlin.Int - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box2 - correspondingProperty: PROPERTY name:test4 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box2 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test4 type:.Box2 visibility:private [final,static]' type=.Box2 origin=null - PROPERTY name:test5 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test5 type:.Box1 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box1' type=.Box1 origin=null - : kotlin.Int - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box1 - correspondingProperty: PROPERTY name:test5 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box1 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test5 type:.Box1 visibility:private [final,static]' type=.Box1 origin=null - PROPERTY name:test6 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test6 type:.Box1 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box1' type=.Box1 origin=null - : kotlin.Int - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box1 - correspondingProperty: PROPERTY name:test6 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box1 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test6 type:.Box1 visibility:private [final,static]' type=.Box1 origin=null - PROPERTY name:test7 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test7 type:.Box2 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box2' type=.Box2 origin=null - : kotlin.Int - : kotlin.Int - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box2 - correspondingProperty: PROPERTY name:test7 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box2 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test7 type:.Box2 visibility:private [final,static]' type=.Box2 origin=null - PROPERTY name:test8 visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:test8 type:.Box2 visibility:private [final,static] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .Box2' type=.Box2 origin=null - : kotlin.String - : kotlin.String - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> () returnType:.Box2 - correspondingProperty: PROPERTY name:test8 visibility:public modality:FINAL [val] - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): .Box2 declared in ' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:test8 type:.Box2 visibility:private [final,static]' type=.Box2 origin=null diff --git a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.kt.txt b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.kt.txt deleted file mode 100644 index 0448040716e..00000000000 --- a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.fir.kt.txt +++ /dev/null @@ -1,57 +0,0 @@ -typealias OneToOne = Box1 -typealias OneToTwo = Box2 -typealias TwoToTwo = Box2 -typealias TwoToTwoReversed = Box2 -typealias TwoToOne = Box1 -typealias OneToOneTransitive = Box1 -typealias TwoToTwoTransitive = Box2 -typealias TwoToTwoTransitive2 = Box2 -class Box1 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -class Box2 { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -val test1: Box1 - field = Box1() - get - -val test2: Box2 - field = Box2() - get - -val test3: Box2 - field = Box2() - get - -val test4: Box2 - field = Box2() - get - -val test5: Box1 - field = Box1() - get - -val test6: Box1 - field = Box1() - get - -val test7: Box2 - field = Box2() - get - -val test8: Box2 - field = Box2() - get diff --git a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt index f180d6a7b6f..5e76eafd1d2 100644 --- a/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt +++ b/compiler/testData/ir/irText/firProblems/TypeAliasConstructorParameterMapping.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // WITH_STDLIB // TARGET_BACKEND: JVM_IR diff --git a/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt b/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt index 489d51db2c0..d711a47c93b 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/kt43342.fir.ir.txt @@ -8,6 +8,17 @@ FILE fqName: fileName:/kt43342.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ControlFlowInfo modality:OPEN visibility:public superTypes:[kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo>]' + PROPERTY name:map visibility:public modality:FINAL [val] + FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final] + EXPRESSION_BODY + GET_VAR 'map: kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=INITIALIZE_PROPERTY_FROM_PARAMETER + FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> + correspondingProperty: PROPERTY name:map visibility:public modality:FINAL [val] + $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> + BLOCK_BODY + RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo' + GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null + receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null FUN DELEGATED_MEMBER name:containsKey visibility:public modality:OPEN <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>, key:K of .ControlFlowInfo) returnType:kotlin.Boolean overridden: public abstract fun containsKey (key: K of kotlin.collections.Map): kotlin.Boolean declared in kotlin.collections.Map @@ -102,17 +113,6 @@ FILE fqName: fileName:/kt43342.kt CALL 'public abstract fun (): kotlin.collections.Collection declared in kotlin.collections.Map' type=kotlin.collections.Collection origin=null $this: GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null - PROPERTY name:map visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final] - EXPRESSION_BODY - GET_VAR 'map: kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo>) returnType:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> - correspondingProperty: PROPERTY name:map visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:map type:kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> visibility:private [final]' type=kotlin.collections.Map.ControlFlowInfo, V of .ControlFlowInfo> origin=null - receiver: GET_VAR ': .ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> declared in .ControlFlowInfo.' type=.ControlFlowInfo.ControlFlowInfo, V of .ControlFlowInfo> origin=null FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.collections.Map diff --git a/compiler/testData/ir/irText/firProblems/kt43342.fir.kt.txt b/compiler/testData/ir/irText/firProblems/kt43342.fir.kt.txt index afe942a34e6..d116a480063 100644 --- a/compiler/testData/ir/irText/firProblems/kt43342.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/kt43342.fir.kt.txt @@ -5,6 +5,10 @@ open class ControlFlowInfo : Map { } + val map: Map + field = map + get + override fun containsKey(key: K): Boolean { return .#map.containsKey(key = key) } diff --git a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt index 902434e0b1a..1360af5f40a 100644 --- a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt +++ b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.ir.txt @@ -40,6 +40,10 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:DelegatedB modality:OPEN visibility:public superTypes:[.B]' + FIELD DELEGATE name:$$delegate_0 type:.C visibility:private [final] + EXPRESSION_BODY + CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null + : kotlin.String FUN DELEGATED_MEMBER name:invoke visibility:public modality:OPEN <> ($this:.DelegatedB) returnType:kotlin.Unit [operator] overridden: public open fun invoke (): kotlin.Unit declared in .B @@ -58,10 +62,6 @@ FILE fqName: fileName:/substitutionOverrideWithDelegate.kt $this: GET_FIELD 'FIELD DELEGATE name:$$delegate_0 type:.C visibility:private [final]' type=.C origin=null receiver: GET_VAR ': .DelegatedB declared in .DelegatedB.invoke' type=.DelegatedB origin=null value: GET_VAR 'value: kotlin.String declared in .DelegatedB.invoke' type=kotlin.String origin=null - FIELD DELEGATE name:$$delegate_0 type:.C visibility:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () declared in .C' type=.C origin=null - : kotlin.String FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .B diff --git a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt index 7ccb128e122..29168cb96ed 100644 --- a/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt +++ b/compiler/testData/ir/irText/firProblems/substitutionOverrideWithDelegate.fir.kt.txt @@ -22,6 +22,7 @@ open class DelegatedB : B { } + private /* final field */ val $$delegate_0: C = C() override operator fun invoke() { .#$$delegate_0.invoke() } @@ -30,8 +31,6 @@ open class DelegatedB : B { .#$$delegate_0.invoke(value = value) } - private /* final field */ val $$delegate_0: C = C() - } interface B : A { @@ -46,3 +45,4 @@ class C : B { } } + diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.ir.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.ir.txt deleted file mode 100644 index 16f7afef002..00000000000 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.ir.txt +++ /dev/null @@ -1,97 +0,0 @@ -FILE fqName: fileName:/integerCoercionToT.kt - TYPEALIAS name:CInt32Var visibility:public expandedType:.CInt32VarX - CLASS INTERFACE name:CPointed modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CPointed - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:reinterpret visibility:public modality:FINAL ($receiver:.CPointed) returnType:T of .reinterpret [inline] - TYPE_PARAMETER name:T index:0 variance: superTypes:[.CPointed] reified:true - $receiver: VALUE_PARAMETER name: type:.CPointed - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun reinterpret (): T of .reinterpret declared in ' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null - CLASS CLASS name:CInt32VarX modality:FINAL visibility:public superTypes:[.CPointed] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.CInt32VarX.CInt32VarX> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> () returnType:.CInt32VarX.CInt32VarX> [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:CInt32VarX modality:FINAL visibility:public superTypes:[.CPointed]' - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CPointed - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .CPointed - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .CPointed - $this: VALUE_PARAMETER name: type:kotlin.Any - PROPERTY name:value visibility:public modality:FINAL [var] - FUN name: visibility:public modality:FINAL ($receiver:.CInt32VarX.>) returnType:T_INT of . - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int] reified:false - $receiver: VALUE_PARAMETER name: type:.CInt32VarX.> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): T_INT of . declared in ' - CALL 'public final fun TODO (): kotlin.Nothing declared in kotlin' type=kotlin.Nothing origin=null - FUN name: visibility:public modality:FINAL ($receiver:.CInt32VarX.>, value:T_INT of .) returnType:kotlin.Unit - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [var] - TYPE_PARAMETER name:T_INT index:0 variance: superTypes:[kotlin.Int] reified:false - $receiver: VALUE_PARAMETER name: type:.CInt32VarX.> - VALUE_PARAMETER name:value index:0 type:T_INT of . - BLOCK_BODY - CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IdType - CONSTRUCTOR visibility:public <> (value:kotlin.Int) returnType:.IdType [primary] - VALUE_PARAMETER name:value index:0 type:kotlin.Int - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:IdType modality:FINAL visibility:public superTypes:[.CPointed]' - PROPERTY name:value visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private [final] - EXPRESSION_BODY - GET_VAR 'value: kotlin.Int declared in .IdType.' type=kotlin.Int origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.IdType) returnType:kotlin.Int - correspondingProperty: PROPERTY name:value visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.IdType - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): kotlin.Int declared in .IdType' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:value type:kotlin.Int visibility:private [final]' type=kotlin.Int origin=null - receiver: GET_VAR ': .IdType declared in .IdType.' type=.IdType origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .CPointed - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .CPointed - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .CPointed - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:foo visibility:public modality:FINAL <> (value:.IdType, cv:.CInt32VarX) returnType:kotlin.Unit - VALUE_PARAMETER name:value index:0 type:.IdType - VALUE_PARAMETER name:cv index:1 type:.CInt32VarX - BLOCK_BODY - CALL 'public final fun (value: T_INT of .): kotlin.Unit declared in ' type=kotlin.Unit origin=EQ - : kotlin.Int - $receiver: GET_VAR 'cv: .CInt32VarX declared in .foo' type=.CInt32VarX origin=null - value: CALL 'public final fun (): kotlin.Int declared in .IdType' type=kotlin.Int origin=GET_PROPERTY - $this: GET_VAR 'value: .IdType declared in .foo' type=.IdType origin=null diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.kt.txt b/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.kt.txt deleted file mode 100644 index f07bb0463ca..00000000000 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.fir.kt.txt +++ /dev/null @@ -1,41 +0,0 @@ -typealias CInt32Var = CInt32VarX -interface CPointed { - -} - -inline fun CPointed.reinterpret(): T { - return TODO() -} - -class CInt32VarX : CPointed { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - -} - -var CInt32VarX.value: T_INT - get(): T_INT { - return TODO() - } - set(value: T_INT) { - } - -class IdType : CPointed { - constructor(value: Int) /* primary */ { - super/*Any*/() - /* () */ - - } - - val value: Int - field = value - get - -} - -fun foo(value: IdType, cv: CInt32VarX) { - cv.(value = value.()) -} diff --git a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt index 5603b4dfb3a..314200e6a18 100644 --- a/compiler/testData/ir/irText/regressions/integerCoercionToT.kt +++ b/compiler/testData/ir/irText/regressions/integerCoercionToT.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL interface CPointed inline fun CPointed.reinterpret(): T = TODO() diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.ir.txt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.ir.txt deleted file mode 100644 index fac022ef452..00000000000 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.ir.txt +++ /dev/null @@ -1,47 +0,0 @@ -FILE fqName: fileName:/typeAliasCtorForGenericClass.kt - TYPEALIAS name:B visibility:public expandedType:.A.B> - TYPE_PARAMETER name:X index:0 variance: superTypes:[kotlin.Any?] reified:false - TYPEALIAS name:B2 visibility:public expandedType:.A<.A.B2>> - TYPE_PARAMETER name:T index:0 variance: superTypes:[kotlin.Any?] reified:false - CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.A.A> - TYPE_PARAMETER name:Q index:0 variance: superTypes:[kotlin.Any?] reified:false - CONSTRUCTOR visibility:public <> (q:Q of .A) returnType:.A.A> [primary] - VALUE_PARAMETER name:q index:0 type:Q of .A - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' - PROPERTY name:q visibility:public modality:FINAL [val] - FIELD PROPERTY_BACKING_FIELD name:q type:Q of .A visibility:private [final] - EXPRESSION_BODY - GET_VAR 'q: Q of .A declared in .A.' type=Q of .A origin=INITIALIZE_PROPERTY_FROM_PARAMETER - FUN DEFAULT_PROPERTY_ACCESSOR name: visibility:public modality:FINAL <> ($this:.A.A>) returnType:Q of .A - correspondingProperty: PROPERTY name:q visibility:public modality:FINAL [val] - $this: VALUE_PARAMETER name: type:.A.A> - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun (): Q of .A declared in .A' - GET_FIELD 'FIELD PROPERTY_BACKING_FIELD name:q type:Q of .A visibility:private [final]' type=Q of .A origin=null - receiver: GET_VAR ': .A.A> declared in .A.' type=.A.A> origin=null - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:bar visibility:public modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - VAR name:b type:.A [val] - CONSTRUCTOR_CALL 'public constructor (q: Q of .A) declared in .A' type=.A origin=null - : kotlin.Int - q: CONST Int type=kotlin.Int value=2 - VAR name:b2 type:.A<.A> [val] - CONSTRUCTOR_CALL 'public constructor (q: Q of .A) declared in .A' type=.A<.A> origin=null - : .A - q: GET_VAR 'val b: .A declared in .bar' type=.A origin=null diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.kt.txt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.kt.txt deleted file mode 100644 index 0ca99317a3c..00000000000 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.fir.kt.txt +++ /dev/null @@ -1,19 +0,0 @@ -typealias B = A -typealias B2 = A> -class A { - constructor(q: Q) /* primary */ { - super/*Any*/() - /* () */ - - } - - val q: Q - field = q - get - -} - -fun bar() { - val b: A = A(q = 2) - val b2: A> = A>(q = b) -} diff --git a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt index a4b34cf3b13..5ac31ff6a53 100644 --- a/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt +++ b/compiler/testData/ir/irText/regressions/typeAliasCtorForGenericClass.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL class A(val q: Q) typealias B = A diff --git a/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt b/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt index 4d74702ba85..4553ade18c5 100644 --- a/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt +++ b/compiler/testData/ir/irText/singletons/enumEntry.fir.kt.txt @@ -39,3 +39,4 @@ open enum class Z : Enum { get(): EnumEntries /* Synthetic body for ENUM_ENTRIES */ } + diff --git a/compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt b/compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt deleted file mode 100644 index 4a474097a8f..00000000000 --- a/compiler/testData/ir/irText/types/javaWildcardType.fir.ir.txt +++ /dev/null @@ -1,132 +0,0 @@ -FILE fqName: fileName:/javaWildcardType.kt - CLASS INTERFACE name:K modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.K - FUN name:kf1 visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.collections.Collection - $this: VALUE_PARAMETER name: type:.K - FUN name:kf2 visibility:public modality:ABSTRACT <> ($this:.K) returnType:kotlin.collections.Collection - $this: VALUE_PARAMETER name: type:.K - FUN name:kg1 visibility:public modality:ABSTRACT <> ($this:.K, c:kotlin.collections.Collection) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection - FUN name:kg2 visibility:public modality:ABSTRACT <> ($this:.K, c:kotlin.collections.Collection) returnType:kotlin.Unit - $this: VALUE_PARAMETER name: type:.K - VALUE_PARAMETER name:c index:0 type:kotlin.collections.Collection - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.J; .K] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.C - CONSTRUCTOR visibility:public <> (j:.J, k:.K) returnType:.C [primary] - VALUE_PARAMETER name:j index:0 type:.J - VALUE_PARAMETER name:k index:1 type:.K - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:FINAL visibility:public superTypes:[.J; .K]' - FUN DELEGATED_MEMBER name:jf1 visibility:public modality:OPEN <> ($this:.C) returnType:@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? - overridden: - public abstract fun jf1 (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? declared in .J - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun jf1 (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? declared in .C' - CALL 'public abstract fun jf1 (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? 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] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? - overridden: - public abstract fun jf2 (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .J - $this: VALUE_PARAMETER name: type:.C - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun jf2 (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .C' - CALL 'public abstract fun jf2 (): @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .J' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? 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] @[FlexibleMutability] kotlin.collections.MutableCollection?) returnType:kotlin.Unit - overridden: - public abstract fun jg1 (c: @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection?): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:c index:0 type:@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? - BLOCK_BODY - CALL 'public abstract fun jg1 (c: @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection?): kotlin.Unit declared in .J' type=kotlin.Unit 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] @[FlexibleMutability] kotlin.collections.MutableCollection? declared in .C.jg1' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection? origin=null - FUN DELEGATED_MEMBER name:jg2 visibility:public modality:OPEN <> ($this:.C, c:@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>?) returnType:kotlin.Unit - overridden: - public abstract fun jg2 (c: @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>?): kotlin.Unit declared in .J - $this: VALUE_PARAMETER name: type:.C - VALUE_PARAMETER name:c index:0 type:@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? - BLOCK_BODY - CALL 'public abstract fun jg2 (c: @[FlexibleNullability] @[FlexibleMutability] 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:private [final]' type=.J origin=null - receiver: GET_VAR ': .C declared in .C.jg2' type=.C origin=null - c: GET_VAR 'c: @[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? declared in .C.jg2' type=@[FlexibleNullability] @[FlexibleMutability] kotlin.collections.MutableCollection<@[FlexibleNullability] kotlin.CharSequence?>? origin=null - 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 - overridden: - public abstract fun kf1 (): kotlin.collections.Collection declared in .K - $this: VALUE_PARAMETER name: type:.C - 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: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: - public abstract fun kf2 (): kotlin.collections.Collection declared in .K - $this: VALUE_PARAMETER name: type:.C - 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: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: - public abstract fun kg1 (c: kotlin.collections.Collection): kotlin.Unit declared in .K - $this: VALUE_PARAMETER name: type:.C - 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: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 - overridden: - public abstract fun kg2 (c: kotlin.collections.Collection): kotlin.Unit declared in .K - $this: VALUE_PARAMETER name: type:.C - 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: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: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] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .J - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .K - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .J - public open fun hashCode (): kotlin.Int declared in .K - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .J - public open fun toString (): kotlin.String declared in .K - $this: VALUE_PARAMETER name: type:kotlin.Any diff --git a/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt b/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt deleted file mode 100644 index 1a678aa2190..00000000000 --- a/compiler/testData/ir/irText/types/javaWildcardType.fir.kt.txt +++ /dev/null @@ -1,55 +0,0 @@ -interface K { - abstract fun kf1(): Collection - - abstract fun kf2(): Collection - - abstract fun kg1(c: Collection) - - abstract fun kg2(c: Collection) - -} - -class C : J, K { - constructor(j: J, k: K) /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun jf1(): @FlexibleNullability @FlexibleMutability MutableCollection? { - return .#$$delegate_0.jf1() - } - - override fun jf2(): @FlexibleNullability @FlexibleMutability MutableCollection<@FlexibleNullability CharSequence?>? { - return .#$$delegate_0.jf2() - } - - override fun jg1(c: @FlexibleNullability @FlexibleMutability MutableCollection?) { - .#$$delegate_0.jg1(c = c) - } - - override fun jg2(c: @FlexibleNullability @FlexibleMutability MutableCollection<@FlexibleNullability CharSequence?>?) { - .#$$delegate_0.jg2(c = c) - } - - private /* final field */ val $$delegate_0: J = j - override fun kf1(): Collection { - return .#$$delegate_1.kf1() - } - - override fun kf2(): Collection { - return .#$$delegate_1.kf2() - } - - override fun kg1(c: Collection) { - .#$$delegate_1.kg1(c = c) - } - - override fun kg2(c: Collection) { - .#$$delegate_1.kg2(c = c) - } - - private /* final field */ val $$delegate_1: K = k - -} - diff --git a/compiler/testData/ir/irText/types/javaWildcardType.kt b/compiler/testData/ir/irText/types/javaWildcardType.kt index 72543abfa93..2d6b4f14751 100644 --- a/compiler/testData/ir/irText/types/javaWildcardType.kt +++ b/compiler/testData/ir/irText/types/javaWildcardType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // TARGET_BACKEND: JVM // FILE: javaWildcardType.kt diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt deleted file mode 100644 index 5a16a4cf292..00000000000 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.ir.txt +++ /dev/null @@ -1,88 +0,0 @@ -Module: lib -Module: main -FILE fqName: fileName:/nullCheckOnInterfaceDelegation.kt - CLASS INTERFACE name:IFoo modality:ABSTRACT visibility:public superTypes:[kotlin.Any] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.IFoo - FUN name:foo visibility:public modality:ABSTRACT <> ($this:.IFoo) returnType:kotlin.String - $this: VALUE_PARAMETER name: type:.IFoo - FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in kotlin.Any - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.A; .IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Derived - CONSTRUCTOR visibility:public <> () returnType:.Derived [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in .A' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Derived modality:FINAL visibility:public superTypes:[.A; .IFoo]' - FUN name:foo visibility:public modality:OPEN <> ($this:.Derived) returnType:@[FlexibleNullability] kotlin.String? - overridden: - public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .A - public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.Derived - BLOCK_BODY - RETURN type=kotlin.Nothing from='public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .Derived' - CALL 'public open fun foo (): @[FlexibleNullability] kotlin.String? declared in .A' superQualifier='CLASS IR_EXTERNAL_JAVA_DECLARATION_STUB CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]' type=@[FlexibleNullability] kotlin.String? origin=null - $this: GET_VAR ': .Derived declared in .Derived.foo' 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] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .A - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .A - public open fun hashCode (): kotlin.Int declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .A - public open fun toString (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo] - $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:.Delegated - CONSTRUCTOR visibility:public <> () returnType:.Delegated [primary] - BLOCK_BODY - DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' - INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:Delegated modality:FINAL visibility:public superTypes:[.IFoo]' - FUN DELEGATED_MEMBER name:foo visibility:public modality:OPEN <> ($this:.Delegated) returnType:kotlin.String - overridden: - public abstract fun foo (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:.Delegated - BLOCK_BODY - 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 open fun foo (): @[FlexibleNullability] kotlin.String? declared in .Derived' type=@[FlexibleNullability] kotlin.String? 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:private [final] - EXPRESSION_BODY - CONSTRUCTOR_CALL 'public constructor () 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] - overridden: - public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - VALUE_PARAMETER name:other index:0 type:kotlin.Any? - FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override] - overridden: - public open fun hashCode (): kotlin.Int declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override] - overridden: - public open fun toString (): kotlin.String declared in .IFoo - $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testReturnValue visibility:public modality:FINAL <> () returnType:kotlin.String - BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testReturnValue (): kotlin.String declared in ' - CALL 'public open fun foo (): kotlin.String declared in .Delegated' type=kotlin.String origin=null - $this: CONSTRUCTOR_CALL 'public constructor () declared in .Delegated' type=.Delegated origin=null diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt deleted file mode 100644 index 5f50bbcb605..00000000000 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.fir.kt.txt +++ /dev/null @@ -1,41 +0,0 @@ -// MODULE: lib -// MODULE: main -// FILE: nullCheckOnInterfaceDelegation.kt - -interface IFoo { - abstract fun foo(): String - -} - -class Derived : A, IFoo { - constructor() /* primary */ { - super/*A*/() - /* () */ - - } - - override fun foo(): @FlexibleNullability String? { - return super.foo() - } - -} - -class Delegated : IFoo { - constructor() /* primary */ { - super/*Any*/() - /* () */ - - } - - override fun foo(): String { - return .#$$delegate_0.foo() /*!! String */ - } - - private /* final field */ val $$delegate_0: Derived = Derived() - -} - -fun testReturnValue(): String { - return Delegated().foo() -} - diff --git a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt index 6cd10d8e3f9..055cf5bef33 100644 --- a/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt +++ b/compiler/testData/ir/irText/types/nullChecks/nullCheckOnInterfaceDelegation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // TARGET_BACKEND: JVM // MODULE: lib diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt index 4ac6a5403c1..f509d20793f 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.ir.txt @@ -84,6 +84,9 @@ FILE fqName: fileName:/rawTypeInSignature.kt BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'public constructor () declared in kotlin.Any' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:KRaw modality:FINAL visibility:public superTypes:[.JRaw]' + FIELD DELEGATE name:$$delegate_0 type:.JRaw visibility:private [final] + EXPRESSION_BODY + GET_VAR 'j: .JRaw declared in .KRaw.' type=.JRaw origin=null FUN DELEGATED_MEMBER name:takesRawList visibility:public modality:OPEN <> ($this:.KRaw, list:@[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList) returnType:kotlin.Unit overridden: public abstract fun takesRawList (list: @[FlexibleNullability] @[FlexibleMutability] @[RawType] kotlin.collections.MutableList): kotlin.Unit declared in .JRaw @@ -164,9 +167,6 @@ FILE fqName: fileName:/rawTypeInSignature.kt 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: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: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] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in .JRaw diff --git a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt index 22da89c5bb1..7f593293494 100644 --- a/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt +++ b/compiler/testData/ir/irText/types/rawTypeInSignature.fir.kt.txt @@ -44,6 +44,7 @@ class KRaw : JRaw { } + private /* final field */ val $$delegate_0: JRaw = j override fun takesRawList(list: @FlexibleNullability @FlexibleMutability @RawType MutableList) { .#$$delegate_0.takesRawList(list = list) } @@ -76,7 +77,5 @@ class KRaw : JRaw { return .#$$delegate_0.returnsRawGenericOut() /*!! @RawType GenericOut */ } - private /* final field */ val $$delegate_0: JRaw = j - } diff --git a/native/native.tests/testData/klib/dump-ir/typealias.ir.fir.txt b/native/native.tests/testData/klib/dump-ir/typealias.ir.fir.txt index cadb5e60856..a3577fe3e60 100644 --- a/native/native.tests/testData/klib/dump-ir/typealias.ir.fir.txt +++ b/native/native.tests/testData/klib/dump-ir/typealias.ir.fir.txt @@ -1,11 +1,11 @@ MODULE_FRAGMENT name: FILE fqName:test fileName:typealias.kt - TYPEALIAS name:PublicTypeAlias visibility:public expandedType:test.ClassName - TYPEALIAS name:InternalTypeAlias visibility:internal expandedType:test.ClassName - TYPEALIAS name:PrivateTypeAlias visibility:private expandedType:test.ClassName CLASS CLASS name:ClassName modality:FINAL visibility:public superTypes:[] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.ClassName CONSTRUCTOR visibility:public <> () returnType:test.ClassName [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'UNBOUND IrConstructorPublicSymbolImpl' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassName modality:FINAL visibility:public superTypes:[]' + TYPEALIAS name:PublicTypeAlias visibility:public expandedType:test.ClassName + TYPEALIAS name:InternalTypeAlias visibility:internal expandedType:test.ClassName + TYPEALIAS name:PrivateTypeAlias visibility:private expandedType:test.ClassName diff --git a/native/native.tests/testData/klib/dump-ir/typealias.sig.ir.fir.txt b/native/native.tests/testData/klib/dump-ir/typealias.sig.ir.fir.txt index e2e546dc510..9124f08e454 100644 --- a/native/native.tests/testData/klib/dump-ir/typealias.sig.ir.fir.txt +++ b/native/native.tests/testData/klib/dump-ir/typealias.sig.ir.fir.txt @@ -1,11 +1,11 @@ MODULE_FRAGMENT name: FILE fqName:test fileName:typealias.kt - TYPEALIAS name:PublicTypeAlias signature:test/PublicTypeAlias|null[0] visibility:public expandedType:test.ClassName - TYPEALIAS name:InternalTypeAlias signature:test/InternalTypeAlias|null[0] visibility:internal expandedType:test.ClassName - TYPEALIAS name:PrivateTypeAlias signature:[ File 'typealias.kt' <- test/PrivateTypeAlias|null[0] ] visibility:private expandedType:test.ClassName CLASS CLASS name:ClassName signature:test/ClassName|null[0] modality:FINAL visibility:public superTypes:[] $this: VALUE_PARAMETER INSTANCE_RECEIVER name: type:test.ClassName CONSTRUCTOR signature:test/ClassName.|(){}[0] visibility:public <> () returnType:test.ClassName [primary] BLOCK_BODY DELEGATING_CONSTRUCTOR_CALL 'UNBOUND IrConstructorPublicSymbolImpl' INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:ClassName signature:test/ClassName|null[0] modality:FINAL visibility:public superTypes:[]' + TYPEALIAS name:PublicTypeAlias signature:test/PublicTypeAlias|null[0] visibility:public expandedType:test.ClassName + TYPEALIAS name:InternalTypeAlias signature:test/InternalTypeAlias|null[0] visibility:internal expandedType:test.ClassName + TYPEALIAS name:PrivateTypeAlias signature:[ File 'typealias.kt' <- test/PrivateTypeAlias|null[0] ] visibility:private expandedType:test.ClassName