diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrAnonymousInitializer.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrAnonymousInitializer.kt index 52f27bd7779..514428513e0 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrAnonymousInitializer.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrAnonymousInitializer.kt @@ -18,9 +18,9 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.ir.expressions.IrBlockBody -import org.jetbrains.kotlin.ir.expressions.IrBody +import org.jetbrains.kotlin.ir.symbols.IrAnonymousInitializerSymbol -interface IrAnonymousInitializer : IrDeclaration { +interface IrAnonymousInitializer : IrSymbolDeclaration { override val descriptor: ClassDescriptor // TODO special descriptor for anonymous initializer blocks override val declarationKind: IrDeclarationKind diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt index afcf1a84aba..c56aa3bc79a 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrClass.kt @@ -17,8 +17,9 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.ClassDescriptor +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol -interface IrClass : IrDeclaration, IrDeclarationContainer, IrTypeParametersContainer { +interface IrClass : IrSymbolDeclaration, IrDeclarationContainer, IrTypeParametersContainer { override val declarationKind: IrDeclarationKind get() = IrDeclarationKind.CLASS diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrConstructor.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrConstructor.kt index 3e0434a6837..913c24be1a2 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrConstructor.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrConstructor.kt @@ -17,9 +17,10 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor +import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol -interface IrConstructor : IrFunction { +interface IrConstructor : IrFunction, IrSymbolDeclaration { override val declarationKind: IrDeclarationKind get() = IrDeclarationKind.CONSTRUCTOR diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt index 6b23be9c74b..c89b66660ac 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrDeclaration.kt @@ -17,9 +17,15 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.DeclarationDescriptor +import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.IrStatement +import org.jetbrains.kotlin.ir.symbols.IrSymbol import org.jetbrains.kotlin.ir.visitors.IrElementTransformer +interface IrSymbolOwner : IrElement { + val symbol: IrSymbol +} + interface IrDeclaration : IrStatement { val descriptor: DeclarationDescriptor val declarationKind: IrDeclarationKind @@ -29,6 +35,10 @@ interface IrDeclaration : IrStatement { accept(transformer, data) as IrStatement } +interface IrSymbolDeclaration : IrDeclaration, IrSymbolOwner { + override val symbol: S +} + enum class IrDeclarationKind { MODULE, FILE, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrEnumEntry.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrEnumEntry.kt index 55b9cae2337..97215879fd5 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrEnumEntry.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrEnumEntry.kt @@ -18,8 +18,9 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.symbols.IrEnumEntrySymbol -interface IrEnumEntry : IrDeclaration { +interface IrEnumEntry : IrSymbolDeclaration { override val declarationKind: IrDeclarationKind get() = IrDeclarationKind.ENUM_ENTRY override val descriptor: ClassDescriptor diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFile.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFile.kt index 05aebed0915..7e574d3ea14 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFile.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFile.kt @@ -21,10 +21,13 @@ import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor import org.jetbrains.kotlin.descriptors.annotations.checkAnnotationName import org.jetbrains.kotlin.ir.IrElement import org.jetbrains.kotlin.ir.SourceManager +import org.jetbrains.kotlin.ir.symbols.IrFileSymbol import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.name.FqName -interface IrFile : IrElement, IrDeclarationContainer { +interface IrFile : IrElement, IrDeclarationContainer, IrSymbolOwner { + override val symbol: IrFileSymbol + val fileEntry: SourceManager.FileEntry val fileAnnotations: MutableList val packageFragmentDescriptor: PackageFragmentDescriptor diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt index 08aca00bdad..73bfd45f5cc 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt @@ -20,6 +20,7 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor import org.jetbrains.kotlin.ir.expressions.IrBody import org.jetbrains.kotlin.ir.expressions.IrExpressionBody +import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol interface IrFunction : IrDeclaration, IrTypeParametersContainer { override val descriptor: FunctionDescriptor @@ -32,7 +33,7 @@ interface IrFunction : IrDeclaration, IrTypeParametersContainer { } -interface IrSimpleFunction : IrFunction { +interface IrSimpleFunction : IrFunction, IrSymbolDeclaration { override val declarationKind: IrDeclarationKind get() = IrDeclarationKind.FUNCTION } diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt index 41365dac19b..daeb2c57a61 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrProperty.kt @@ -18,6 +18,7 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.ir.expressions.IrExpressionBody +import org.jetbrains.kotlin.ir.symbols.IrFieldSymbol interface IrProperty : IrDeclaration { override val descriptor: PropertyDescriptor @@ -31,7 +32,7 @@ interface IrProperty : IrDeclaration { get() = IrDeclarationKind.PROPERTY } -interface IrField : IrDeclaration { +interface IrField : IrSymbolDeclaration { override val descriptor: PropertyDescriptor override val declarationKind: IrDeclarationKind diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrTypeParameter.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrTypeParameter.kt index be389a5e5a7..c032aeb701b 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrTypeParameter.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrTypeParameter.kt @@ -17,9 +17,10 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor +import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol import org.jetbrains.kotlin.ir.visitors.IrElementTransformer -interface IrTypeParameter : IrDeclaration { +interface IrTypeParameter : IrSymbolDeclaration { override val declarationKind: IrDeclarationKind get() = IrDeclarationKind.TYPE_PARAMETER diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrValueParameter.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrValueParameter.kt index e91d3f61150..5dda400fdf1 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrValueParameter.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrValueParameter.kt @@ -18,9 +18,10 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.ParameterDescriptor import org.jetbrains.kotlin.ir.expressions.IrExpressionBody +import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol import org.jetbrains.kotlin.ir.visitors.IrElementTransformer -interface IrValueParameter : IrDeclaration { +interface IrValueParameter : IrSymbolDeclaration { override val declarationKind: IrDeclarationKind get() = IrDeclarationKind.VALUE_PARAMETER diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrVariable.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrVariable.kt index dd97d035898..42a2718d8c1 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrVariable.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrVariable.kt @@ -18,8 +18,9 @@ package org.jetbrains.kotlin.ir.declarations import org.jetbrains.kotlin.descriptors.VariableDescriptor import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol -interface IrVariable : IrDeclaration { +interface IrVariable : IrSymbolDeclaration { override val descriptor: VariableDescriptor override val declarationKind: IrDeclarationKind diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt index a486a762196..3066a7d5682 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrAnonymousInitializerImpl.kt @@ -17,12 +17,11 @@ package org.jetbrains.kotlin.ir.declarations.impl import org.jetbrains.kotlin.descriptors.ClassDescriptor -import org.jetbrains.kotlin.ir.* import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer -import org.jetbrains.kotlin.ir.declarations.impl.IrDeclarationBase import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.expressions.IrBlockBody -import org.jetbrains.kotlin.ir.expressions.IrBody +import org.jetbrains.kotlin.ir.symbols.IrAnonymousInitializerSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrAnonymousInitializerSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -30,8 +29,13 @@ class IrAnonymousInitializerImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: ClassDescriptor + override val descriptor: ClassDescriptor, + override val symbol: IrAnonymousInitializerSymbol ) : IrDeclarationBase(startOffset, endOffset, origin), IrAnonymousInitializer { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrAnonymousInitializerSymbolImpl(descriptor)) + constructor( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassDescriptor, body: IrBlockBody diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt index 605f0fb9a4a..9d377a00efa 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrClassImpl.kt @@ -18,6 +18,8 @@ package org.jetbrains.kotlin.ir.declarations.impl import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrClassSymbolImpl import org.jetbrains.kotlin.ir.util.transform import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -28,8 +30,13 @@ class IrClassImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: ClassDescriptor + override val descriptor: ClassDescriptor, + override val symbol: IrClassSymbol ) : IrDeclarationBase(startOffset, endOffset, origin), IrClass { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrClassSymbolImpl(descriptor)) + constructor( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassDescriptor, members: List diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt index fc8146a9256..e1f49e2fbb9 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrConstructorImpl.kt @@ -20,12 +20,19 @@ import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor import org.jetbrains.kotlin.ir.declarations.IrConstructor import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.expressions.IrBody +import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrConstructorSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementVisitor class IrConstructorImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: ClassConstructorDescriptor + override val descriptor: ClassConstructorDescriptor, + override val symbol: IrConstructorSymbol ) : IrFunctionBase(startOffset, endOffset, origin), IrConstructor { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassConstructorDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrConstructorSymbolImpl(descriptor)) + constructor( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassConstructorDescriptor, body: IrBody diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt index 8c87e864cfc..8efb0910388 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrEnumEntryImpl.kt @@ -21,6 +21,8 @@ import org.jetbrains.kotlin.ir.declarations.IrClass import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrEnumEntry import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.symbols.IrEnumEntrySymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrEnumEntrySymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -28,8 +30,13 @@ class IrEnumEntryImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: ClassDescriptor + override val descriptor: ClassDescriptor, + override val symbol: IrEnumEntrySymbol ) : IrDeclarationBase(startOffset, endOffset, origin), IrEnumEntry { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrEnumEntrySymbolImpl(descriptor)) + constructor( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ClassDescriptor, correspondingClass: IrClass?, initializerExpression: IrExpression diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt index 5c7b99133ce..b82f2ac47c1 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFieldImpl.kt @@ -19,8 +19,9 @@ package org.jetbrains.kotlin.ir.declarations.impl import org.jetbrains.kotlin.descriptors.PropertyDescriptor import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrField -import org.jetbrains.kotlin.ir.expressions.IrBody import org.jetbrains.kotlin.ir.expressions.IrExpressionBody +import org.jetbrains.kotlin.ir.symbols.IrFieldSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrFieldSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -29,8 +30,13 @@ class IrFieldImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: PropertyDescriptor + override val descriptor: PropertyDescriptor, + override val symbol: IrFieldSymbol ): IrDeclarationBase(startOffset, endOffset, origin), IrField { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: PropertyDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrFieldSymbolImpl(descriptor)) + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: PropertyDescriptor, initializer: IrExpressionBody? ) : this(startOffset, endOffset, origin, descriptor) { 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 5daf63c027a..2b5dd1b77ac 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 @@ -18,9 +18,12 @@ package org.jetbrains.kotlin.ir.declarations.impl import org.jetbrains.kotlin.descriptors.PackageFragmentDescriptor import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.kotlin.ir.* +import org.jetbrains.kotlin.ir.IrElementBase +import org.jetbrains.kotlin.ir.SourceManager import org.jetbrains.kotlin.ir.declarations.IrDeclaration import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.ir.symbols.IrFileSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrFileSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor import org.jetbrains.kotlin.utils.SmartList @@ -28,11 +31,18 @@ import java.util.* class IrFileImpl( override val fileEntry: SourceManager.FileEntry, - override val packageFragmentDescriptor: PackageFragmentDescriptor + override val packageFragmentDescriptor: PackageFragmentDescriptor, + override val symbol: IrFileSymbol ) : IrElementBase(0, fileEntry.maxOffset), IrFile { + constructor(fileEntry: SourceManager.FileEntry, packageFragmentDescriptor: PackageFragmentDescriptor) + : this(fileEntry, packageFragmentDescriptor, + IrFileSymbolImpl(packageFragmentDescriptor)) + constructor( - fileEntry: SourceManager.FileEntry, packageFragmentDescriptor: PackageFragmentDescriptor, - fileAnnotations: List, declarations: List + fileEntry: SourceManager.FileEntry, + packageFragmentDescriptor: PackageFragmentDescriptor, + fileAnnotations: List, + declarations: List ) : this(fileEntry, packageFragmentDescriptor) { this.fileAnnotations.addAll(fileAnnotations) this.declarations.addAll(declarations) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt index 12b19d84138..7e252b2e811 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionImpl.kt @@ -20,14 +20,21 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction import org.jetbrains.kotlin.ir.expressions.IrBody +import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrSimpleFunctionSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementVisitor class IrFunctionImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: FunctionDescriptor + override val descriptor: FunctionDescriptor, + override val symbol: IrSimpleFunctionSymbol ) : IrFunctionBase(startOffset, endOffset, origin), IrSimpleFunction { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: FunctionDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrSimpleFunctionSymbolImpl(descriptor)) + constructor( startOffset: Int, endOffset: Int, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt index ffcf58d4ecb..5816f13c0ef 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrTypeParameterImpl.kt @@ -19,6 +19,8 @@ package org.jetbrains.kotlin.ir.declarations.impl import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrTypeParameter +import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -26,8 +28,13 @@ class IrTypeParameterImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: TypeParameterDescriptor + override val descriptor: TypeParameterDescriptor, + override val symbol: IrTypeParameterSymbol ) : IrDeclarationBase(startOffset, endOffset, origin), IrTypeParameter { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: TypeParameterDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrTypeParameterSymbolImpl(descriptor)) + override fun accept(visitor: IrElementVisitor, data: D): R = visitor.visitTypeParameter(this, data) diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt index 7721c9bc044..c0907808795 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrValueParameterImpl.kt @@ -22,6 +22,8 @@ import org.jetbrains.kotlin.ir.declarations.IrValueParameter import org.jetbrains.kotlin.ir.expressions.IrExpression import org.jetbrains.kotlin.ir.expressions.IrExpressionBody import org.jetbrains.kotlin.ir.expressions.impl.IrExpressionBodyImpl +import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -29,8 +31,13 @@ class IrValueParameterImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: ParameterDescriptor + override val descriptor: ParameterDescriptor, + override val symbol: IrValueParameterSymbol ) : IrDeclarationBase(startOffset, endOffset, origin), IrValueParameter { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ParameterDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrValueParameterSymbolImpl(descriptor)) + constructor( startOffset: Int, endOffset: Int, @@ -49,6 +56,7 @@ class IrValueParameterImpl( defaultValue: IrExpression ) : this(startOffset, endOffset, origin, descriptor, IrExpressionBodyImpl(defaultValue)) + override var defaultValue: IrExpressionBody? = null override fun accept(visitor: IrElementVisitor, data: D): R = diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt index 1bdb5d69171..34760195d5f 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrVariableImpl.kt @@ -20,6 +20,8 @@ import org.jetbrains.kotlin.descriptors.VariableDescriptor import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrVariable import org.jetbrains.kotlin.ir.expressions.IrExpression +import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol +import org.jetbrains.kotlin.ir.symbols.impl.IrVariableSymbolImpl import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -27,8 +29,13 @@ class IrVariableImpl( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, - override val descriptor: VariableDescriptor + override val descriptor: VariableDescriptor, + override val symbol: IrVariableSymbol ) : IrDeclarationBase(startOffset, endOffset, origin), IrVariable { + constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: VariableDescriptor) : + this(startOffset, endOffset, origin, descriptor, + IrVariableSymbolImpl(descriptor)) + constructor( startOffset: Int, endOffset: Int, diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol.kt deleted file mode 100644 index ffe5f9ed1b5..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer - -interface IrAnonymousInitializerSymbol : IrDeclarationSymbol { - override val declaration: IrAnonymousInitializer -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallableSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallableSymbol.kt deleted file mode 100644 index a5065cc8533..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallableSymbol.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrFunction -import org.jetbrains.kotlin.types.KotlinType - -interface IrCallableSymbol : IrMemberSymbol { - override val declaration: IrFunction - - val returnType: KotlinType -} - diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassSymbol.kt deleted file mode 100644 index cafaa6825a8..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassSymbol.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.descriptors.ClassKind -import org.jetbrains.kotlin.ir.declarations.IrClass -import org.jetbrains.kotlin.types.KotlinType - -interface IrClassSymbol : IrClassifierSymbol { - override val declaration: IrClass - - val kind: ClassKind - val supertypes: List - val isCompanionObject: Boolean - val isData: Boolean -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassifierSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassifierSymbol.kt deleted file mode 100644 index 98d827b0960..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassifierSymbol.kt +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -interface IrClassifierSymbol : IrMemberSymbol { - // TODO type constructor for symbols? - // val typeConstructor: TypeConstructor -} diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrConstructorSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrConstructorSymbol.kt deleted file mode 100644 index b04cb466df6..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrConstructorSymbol.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrConstructor - -interface IrConstructorSymbol : IrCallableSymbol { - override val declaration: IrConstructor -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrDeclarationSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrDeclarationSymbol.kt deleted file mode 100644 index 7a456f0e735..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrDeclarationSymbol.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrDeclaration - -interface IrDeclarationSymbol : IrSymbol { - val declaration: IrDeclaration - val container: IrSymbol -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol.kt deleted file mode 100644 index bf211266485..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrEnumEntry - -interface IrEnumEntrySymbol : IrMemberSymbol { - override val declaration: IrEnumEntry - - val ordinal: Int -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFieldSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFieldSymbol.kt deleted file mode 100644 index d8bfdced6e2..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFieldSymbol.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrField -import org.jetbrains.kotlin.types.KotlinType - -interface IrFieldSymbol : IrMemberSymbol { - override val declaration: IrField - - val type: KotlinType - val isMutable: Boolean -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFileSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFileSymbol.kt deleted file mode 100644 index 20333c51dc8..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFileSymbol.kt +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrFile -import org.jetbrains.kotlin.name.FqName - -interface IrFileSymbol : IrSymbol { - val fileName: String - val packageFqName: FqName - val element: IrFile -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFunctionSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFunctionSymbol.kt deleted file mode 100644 index 891e2ece9fb..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFunctionSymbol.kt +++ /dev/null @@ -1,21 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -interface IrFunctionSymbol : IrCallableSymbol { - val overridden: List -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrMemberSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrMemberSymbol.kt deleted file mode 100644 index 2badecb5bbb..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrMemberSymbol.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility - -interface IrMemberSymbol : IrNamedSymbol { - val modality: Modality - val visibility: Visibility -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrNamedSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrNamedSymbol.kt deleted file mode 100644 index 32b8dcf1fea..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrNamedSymbol.kt +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.name.Name - -interface IrNamedSymbol : IrDeclarationSymbol { - val name: Name -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt index 90a91491cc6..d1ec3986300 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt @@ -16,10 +16,34 @@ package org.jetbrains.kotlin.ir.symbols -import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.ir.declarations.* interface IrSymbol { - val annotations: MutableList + val owner : IrSymbolOwner + val descriptor: DeclarationDescriptor } +interface IrBindableSymbol : IrSymbol{ + override val owner: B + override val descriptor: D + fun bind(owner: B) +} + +interface IrAnonymousInitializerSymbol : IrBindableSymbol +interface IrClassSymbol : IrBindableSymbol +interface IrEnumEntrySymbol : IrBindableSymbol +interface IrFileSymbol : IrBindableSymbol +interface IrFieldSymbol : IrBindableSymbol + +interface IrTypeParameterSymbol : IrBindableSymbol +interface IrValueParameterSymbol : IrBindableSymbol +interface IrVariableSymbol : IrBindableSymbol + +interface IrFunctionSymbol : IrSymbol { + override val descriptor: FunctionDescriptor +} + +interface IrConstructorSymbol : IrFunctionSymbol, IrBindableSymbol +interface IrSimpleFunctionSymbol : IrFunctionSymbol, IrBindableSymbol \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol.kt deleted file mode 100644 index 16b76370a67..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.types.KotlinType -import org.jetbrains.kotlin.types.Variance - -interface IrTypeParameterSymbol : IrClassifierSymbol { - // TODO IrTypeParameter - // override val declaration: IrTypeParameter - - val isReified: Boolean - val variance: Variance - val upperBounds: List - val index: Int -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol.kt deleted file mode 100644 index 9b4cb16ab25..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -interface IrValueParameterSymbol : IrValueSymbol { - // TODO IrValueParameter - // override val declaration: IrValueParameter - - val index: Int -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueSymbol.kt deleted file mode 100644 index 591455494c8..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueSymbol.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.types.KotlinType - -interface IrValueSymbol : IrNamedSymbol { - val type: KotlinType -} - diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrVariableSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrVariableSymbol.kt deleted file mode 100644 index 98fc262bc67..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrVariableSymbol.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols - -import org.jetbrains.kotlin.ir.declarations.IrVariable - -interface IrVariableSymbol : IrValueSymbol { - override val declaration: IrVariable - - val isMutable: Boolean -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrAnonymousInitializerSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrAnonymousInitializerSymbolImpl.kt deleted file mode 100644 index edd9c569e99..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrAnonymousInitializerSymbolImpl.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer -import org.jetbrains.kotlin.ir.symbols.IrAnonymousInitializerSymbol - -class IrAnonymousInitializerSymbolImpl() : IrDeclarationSymbolBase(), IrAnonymousInitializerSymbol { - override lateinit var declaration: IrAnonymousInitializer - - constructor(declaration: IrAnonymousInitializer) : this() { - this.declaration = declaration - } -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrBindableSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrBindableSymbolBase.kt new file mode 100644 index 00000000000..f7f3edbd1c2 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrBindableSymbolBase.kt @@ -0,0 +1,76 @@ +/* + * 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. + */ + +package org.jetbrains.kotlin.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.* +import org.jetbrains.kotlin.ir.declarations.* +import org.jetbrains.kotlin.ir.symbols.* + +abstract class IrBindableSymbolBase( + override val descriptor: D +) : IrBindableSymbol { + private var _owner: B? = null + override val owner: B + get() = _owner ?: throw IllegalStateException("Symbol for $descriptor is unbound") + + override fun bind(owner: B) { + if (_owner == null) + _owner = owner + else + throw IllegalStateException("Symbol for $descriptor is already bound") + } +} + +class IrAnonymousInitializerSymbolImpl(descriptor: ClassDescriptor) : + IrBindableSymbolBase(descriptor), + IrAnonymousInitializerSymbol + +class IrClassSymbolImpl(descriptor: ClassDescriptor) : + IrBindableSymbolBase(descriptor), + IrClassSymbol + +class IrEnumEntrySymbolImpl(descriptor: ClassDescriptor) : + IrBindableSymbolBase(descriptor), + IrEnumEntrySymbol + +class IrFileSymbolImpl(descriptor: PackageFragmentDescriptor) : + IrBindableSymbolBase(descriptor), + IrFileSymbol + +class IrFieldSymbolImpl(descriptor: PropertyDescriptor) : + IrBindableSymbolBase(descriptor), + IrFieldSymbol + +class IrTypeParameterSymbolImpl(descriptor: TypeParameterDescriptor) : + IrBindableSymbolBase(descriptor), + IrTypeParameterSymbol + +class IrValueParameterSymbolImpl(descriptor: ParameterDescriptor) : + IrBindableSymbolBase(descriptor), + IrValueParameterSymbol + +class IrVariableSymbolImpl(descriptor: VariableDescriptor) : + IrBindableSymbolBase(descriptor), + IrVariableSymbol + +class IrSimpleFunctionSymbolImpl(descriptor: FunctionDescriptor) : + IrBindableSymbolBase(descriptor), + IrSimpleFunctionSymbol + +class IrConstructorSymbolImpl(descriptor: ClassConstructorDescriptor) : + IrBindableSymbolBase(descriptor), + IrConstructorSymbol \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrCallableSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrCallableSymbolBase.kt deleted file mode 100644 index b3823877573..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrCallableSymbolBase.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.symbols.IrCallableSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType - -abstract class IrCallableSymbolBase( - name: Name, - modality: Modality, - visibility: Visibility, - override val returnType: KotlinType -) : IrMemberSymbolBase(name, modality, visibility), IrCallableSymbol - - diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassSymbolImpl.kt deleted file mode 100644 index 1a935e81685..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassSymbolImpl.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.ClassKind -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.declarations.IrClass -import org.jetbrains.kotlin.ir.symbols.IrClassSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType - -class IrClassSymbolImpl( - name: Name, - modality: Modality, - visibility: Visibility, - override val kind: ClassKind, - override val supertypes: List, - override val isData: Boolean, - override val isCompanionObject: Boolean -) : IrClassifierSymbolBase(name, modality, visibility), IrClassSymbol { - override lateinit var declaration: IrClass -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassifierSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassifierSymbolBase.kt deleted file mode 100644 index 48443dee6ff..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassifierSymbolBase.kt +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol -import org.jetbrains.kotlin.name.Name - -abstract class IrClassifierSymbolBase( - name: Name, - modality: Modality, - visibility: Visibility -) : IrMemberSymbolBase(name, modality, visibility), - IrClassifierSymbol diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrConstructorSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrConstructorSymbolImpl.kt deleted file mode 100644 index 056b20d289b..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrConstructorSymbolImpl.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.declarations.IrConstructor -import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType - -class IrConstructorSymbolImpl( - name: Name, - modality: Modality, - visibility: Visibility, - returnType: KotlinType -) : IrCallableSymbolBase(name, modality, visibility, returnType), IrConstructorSymbol { - override lateinit var declaration: IrConstructor -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrDeclarationSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrDeclarationSymbolBase.kt deleted file mode 100644 index 986054d1772..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrDeclarationSymbolBase.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.ir.symbols.IrDeclarationSymbol -import org.jetbrains.kotlin.ir.symbols.IrSymbol - -abstract class IrDeclarationSymbolBase : IrSymbolBase(), IrDeclarationSymbol { - override final lateinit var container: IrSymbol -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrEnumEntrySymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrEnumEntrySymbolImpl.kt deleted file mode 100644 index f090c3209cc..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrEnumEntrySymbolImpl.kt +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.declarations.IrEnumEntry -import org.jetbrains.kotlin.ir.symbols.IrEnumEntrySymbol -import org.jetbrains.kotlin.name.Name - -class IrEnumEntrySymbolImpl( - name: Name, - modality: Modality, - visibility: Visibility, - override val ordinal: Int -) : IrMemberSymbolBase(name, modality, visibility), IrEnumEntrySymbol { - override lateinit var declaration: IrEnumEntry -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFieldSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFieldSymbolImpl.kt deleted file mode 100644 index b7b52173015..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFieldSymbolImpl.kt +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.declarations.IrField -import org.jetbrains.kotlin.ir.symbols.IrFieldSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType - -class IrFieldSymbolImpl( - name: Name, - modality: Modality, - visibility: Visibility, - override val type: KotlinType, - override val isMutable: Boolean -) : IrMemberSymbolBase(name, modality, visibility), IrFieldSymbol { - override lateinit var declaration: IrField -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFileSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFileSymbolImpl.kt deleted file mode 100644 index 4b5f95da806..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFileSymbolImpl.kt +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.ir.declarations.IrFile -import org.jetbrains.kotlin.ir.symbols.IrFileSymbol -import org.jetbrains.kotlin.name.FqName - -class IrFileSymbolImpl( - override val fileName: String, - override val packageFqName: FqName -) : IrSymbolBase(), IrFileSymbol { - override lateinit var element: IrFile -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFunctionSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFunctionSymbolImpl.kt deleted file mode 100644 index 5d1d7239b17..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFunctionSymbolImpl.kt +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.declarations.IrFunction -import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol -import org.jetbrains.kotlin.ir.symbols.IrSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType -import org.jetbrains.kotlin.utils.SmartList - -class IrFunctionSymbolImpl( - name: Name, - modality: Modality, - visibility: Visibility, - returnType: KotlinType -) : IrCallableSymbolBase(name, modality, visibility, returnType), IrFunctionSymbol { - override lateinit var declaration: IrFunction - - override val overridden: MutableList = SmartList() -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrMemberSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrMemberSymbolBase.kt deleted file mode 100644 index 12e26b6ac6f..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrMemberSymbolBase.kt +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.symbols.IrMemberSymbol -import org.jetbrains.kotlin.ir.symbols.IrSymbol -import org.jetbrains.kotlin.name.Name - -abstract class IrMemberSymbolBase( - name: Name, - override val modality: Modality, - override val visibility: Visibility -) : IrNamedSymbolBase(name), IrMemberSymbol { - constructor(name: Name, modality: Modality, visibility: Visibility, container: IrSymbol) : this(name, modality, visibility) { - this.container = container - } -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrNamedSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrNamedSymbolBase.kt deleted file mode 100644 index 7488e1c78ce..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrNamedSymbolBase.kt +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.ir.symbols.IrNamedSymbol -import org.jetbrains.kotlin.name.Name - -abstract class IrNamedSymbolBase( - override val name: Name -) : IrDeclarationSymbolBase(), IrNamedSymbol \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrSymbolBase.kt deleted file mode 100644 index 6eee6071cbf..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrSymbolBase.kt +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor -import org.jetbrains.kotlin.ir.symbols.IrSymbol -import org.jetbrains.kotlin.utils.SmartList - -abstract class IrSymbolBase : IrSymbol { - override val annotations: MutableList = SmartList() -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrTypeParameterSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrTypeParameterSymbolImpl.kt deleted file mode 100644 index c269609d3d8..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrTypeParameterSymbolImpl.kt +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.descriptors.Modality -import org.jetbrains.kotlin.descriptors.Visibility -import org.jetbrains.kotlin.ir.declarations.IrDeclaration -import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType -import org.jetbrains.kotlin.types.Variance - -class IrTypeParameterSymbolImpl( - name: Name, - modality: Modality, - visibility: Visibility, - override val variance: Variance, - override val upperBounds: List, - override val index: Int, - override val isReified: Boolean -) : IrClassifierSymbolBase(name, modality, visibility), IrTypeParameterSymbol { - // TODO IrTypeParameter - override lateinit var declaration: IrDeclaration -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueParameterSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueParameterSymbolImpl.kt deleted file mode 100644 index 35e441ead84..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueParameterSymbolImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.ir.declarations.IrDeclaration -import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType - -class IrValueParameterSymbolImpl( - name: Name, - type: KotlinType, - override val index: Int -) : IrValueSymbolBase(name, type), IrValueParameterSymbol { - override lateinit var declaration: IrDeclaration -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueSymbolBase.kt deleted file mode 100644 index 7337be089e8..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueSymbolBase.kt +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.ir.symbols.IrValueSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType - -abstract class IrValueSymbolBase( - name: Name, - override val type: KotlinType -) : IrNamedSymbolBase(name), IrValueSymbol - diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrVariableSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrVariableSymbolImpl.kt deleted file mode 100644 index 6dc32fa16bb..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrVariableSymbolImpl.kt +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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. - */ - -package org.jetbrains.kotlin.ir.symbols.impl - -import org.jetbrains.kotlin.ir.declarations.IrVariable -import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol -import org.jetbrains.kotlin.name.Name -import org.jetbrains.kotlin.types.KotlinType - -class IrVariableSymbolImpl( - name: Name, - type: KotlinType, - override val isMutable: Boolean -) : IrValueSymbolBase(name, type), IrVariableSymbol { - override lateinit var declaration: IrVariable -} \ No newline at end of file