From 46162395be45a5e5c0bb104ff8bfc8b9e16f5f73 Mon Sep 17 00:00:00 2001 From: Wojciech Litewka Date: Fri, 1 Mar 2024 09:51:55 +0100 Subject: [PATCH] [IR] Extract IrFileImpl secondary constructors to functions #KT-65773 In Progress --- .../kotlin/ir/declarations/impl/IrFileImpl.kt | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt index 016321412f4..286bb7d1ab9 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFileImpl.kt @@ -22,26 +22,6 @@ class IrFileImpl( override val symbol: IrFileSymbol, override var packageFqName: FqName ) : IrFile() { - constructor( - fileEntry: IrFileEntry, - packageFragmentDescriptor: PackageFragmentDescriptor - ) : this(fileEntry, IrFileSymbolImpl(packageFragmentDescriptor), packageFragmentDescriptor.fqName) - - constructor( - fileEntry: IrFileEntry, - packageFragmentDescriptor: PackageFragmentDescriptor, - module: IrModuleFragment, - ) : this(fileEntry, IrFileSymbolImpl(packageFragmentDescriptor), packageFragmentDescriptor.fqName, module) - - constructor( - fileEntry: IrFileEntry, - symbol: IrFileSymbol, - fqName: FqName, - module: IrModuleFragment - ) : this(fileEntry, symbol, fqName) { - this.module = module - } - init { symbol.bind(this) } @@ -64,3 +44,23 @@ class IrFileImpl( override var metadata: MetadataSource? = null } + +fun IrFileImpl( + fileEntry: IrFileEntry, + symbol: IrFileSymbol, + fqName: FqName, + module: IrModuleFragment, +) = IrFileImpl(fileEntry, symbol, fqName).apply { + this.module = module +} + +fun IrFileImpl( + fileEntry: IrFileEntry, + packageFragmentDescriptor: PackageFragmentDescriptor, +) = IrFileImpl(fileEntry, IrFileSymbolImpl(packageFragmentDescriptor), packageFragmentDescriptor.fqName) + +fun IrFileImpl( + fileEntry: IrFileEntry, + packageFragmentDescriptor: PackageFragmentDescriptor, + module: IrModuleFragment, +) = IrFileImpl(fileEntry, IrFileSymbolImpl(packageFragmentDescriptor), packageFragmentDescriptor.fqName, module)