diff --git a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/MoveBodilessDeclarationsToSeparatePlace.kt b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/MoveBodilessDeclarationsToSeparatePlace.kt index 948a3b33230..3a812e56db2 100644 --- a/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/MoveBodilessDeclarationsToSeparatePlace.kt +++ b/compiler/ir/backend.js/src/org/jetbrains/kotlin/ir/backend/js/lower/MoveBodilessDeclarationsToSeparatePlace.kt @@ -1,5 +1,5 @@ /* - * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ @@ -7,16 +7,13 @@ package org.jetbrains.kotlin.ir.backend.js.lower import org.jetbrains.kotlin.backend.common.DeclarationTransformer import org.jetbrains.kotlin.backend.common.ir.addChild -import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor import org.jetbrains.kotlin.ir.IrElement -import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI import org.jetbrains.kotlin.ir.backend.js.JsIrBackendContext import org.jetbrains.kotlin.ir.backend.js.utils.getJsModule import org.jetbrains.kotlin.ir.backend.js.utils.getJsQualifier import org.jetbrains.kotlin.ir.declarations.* import org.jetbrains.kotlin.ir.declarations.impl.IrFileImpl -import org.jetbrains.kotlin.ir.symbols.IrFileSymbol -import org.jetbrains.kotlin.ir.util.IdSignature +import org.jetbrains.kotlin.ir.symbols.impl.IrFileSymbolImpl import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable import org.jetbrains.kotlin.ir.util.isEffectivelyExternal import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid @@ -45,28 +42,6 @@ private val BODILESS_BUILTIN_CLASSES = listOf( "kotlin.Function" ).map { FqName(it) }.toSet() -private class DescriptorlessIrFileSymbol : IrFileSymbol { - override fun bind(owner: IrFile) { - _owner = owner - } - - @ObsoleteDescriptorBasedAPI - override val descriptor: PackageFragmentDescriptor - get() = error("Operation is unsupported") - - @ObsoleteDescriptorBasedAPI - override val hasDescriptor: Boolean - get() = error("Operation is unsupported") - - private var _owner: IrFile? = null - override val owner get() = _owner!! - - override val isBound get() = _owner != null - - override val signature: IdSignature? - get() = null -} - private fun isBuiltInClass(declaration: IrDeclaration): Boolean = declaration is IrClass && declaration.fqNameWhenAvailable in BODILESS_BUILTIN_CLASSES @@ -85,7 +60,7 @@ class MoveBodilessDeclarationsToSeparatePlaceLowering(private val context: JsIrB val externalPackageFragment by lazy { context.externalPackageFragment.getOrPut(irFile.symbol) { - IrFileImpl(fileEntry = irFile.fileEntry, fqName = irFile.fqName, symbol = DescriptorlessIrFileSymbol()).also { + IrFileImpl(fileEntry = irFile.fileEntry, fqName = irFile.fqName, symbol = IrFileSymbolImpl()).also { it.annotations += irFile.annotations } } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrPrivateSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrPrivateSymbolBase.kt index ad023bbf91d..b1b64619d71 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrPrivateSymbolBase.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrPrivateSymbolBase.kt @@ -1,17 +1,6 @@ /* - * Copyright 2010-2017 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. */ package org.jetbrains.kotlin.ir.symbols.impl @@ -83,11 +72,11 @@ abstract class IrBindableSymbolBase(descriptor), IrFileSymbol -class IrExternalPackageFragmentSymbolImpl(descriptor: PackageFragmentDescriptor) : +class IrExternalPackageFragmentSymbolImpl(descriptor: PackageFragmentDescriptor? = null) : IrBindableSymbolBase(descriptor), IrExternalPackageFragmentSymbol