IR: make subtypes of IrDeclaration classes
This commit is contained in:
@@ -31,7 +31,7 @@ class Fir2IrLazyClass(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val fir: FirRegularClass,
|
||||
override val symbol: Fir2IrClassSymbol,
|
||||
) : IrClass, AbstractFir2IrLazyDeclaration<FirRegularClass, IrClass>, Fir2IrComponents by components {
|
||||
) : IrClass(), AbstractFir2IrLazyDeclaration<FirRegularClass, IrClass>, Fir2IrComponents by components {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
classifierStorage.preCacheTypeParameters(fir)
|
||||
|
||||
@@ -29,7 +29,7 @@ class Fir2IrLazyConstructor(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val fir: FirConstructor,
|
||||
override val symbol: Fir2IrConstructorSymbol,
|
||||
) : IrConstructor, AbstractFir2IrLazyDeclaration<FirConstructor, IrConstructor>, Fir2IrComponents by components {
|
||||
) : IrConstructor(), AbstractFir2IrLazyDeclaration<FirConstructor, IrConstructor>, Fir2IrComponents by components {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
classifierStorage.preCacheTypeParameters(fir)
|
||||
|
||||
@@ -32,7 +32,7 @@ class Fir2IrLazyProperty(
|
||||
override val fir: FirProperty,
|
||||
override val symbol: Fir2IrPropertySymbol,
|
||||
override val isFakeOverride: Boolean
|
||||
) : IrProperty, AbstractFir2IrLazyDeclaration<FirProperty, IrProperty>, Fir2IrComponents by components {
|
||||
) : IrProperty(), AbstractFir2IrLazyDeclaration<FirProperty, IrProperty>, Fir2IrComponents by components {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
classifierStorage.preCacheTypeParameters(fir)
|
||||
|
||||
@@ -33,7 +33,7 @@ class Fir2IrLazySimpleFunction(
|
||||
firParent: FirRegularClass,
|
||||
override val symbol: Fir2IrSimpleFunctionSymbol,
|
||||
override val isFakeOverride: Boolean
|
||||
) : IrSimpleFunction, AbstractFir2IrLazyDeclaration<FirSimpleFunction, IrSimpleFunction>, Fir2IrComponents by components {
|
||||
) : IrSimpleFunction(), AbstractFir2IrLazyDeclaration<FirSimpleFunction, IrSimpleFunction>, Fir2IrComponents by components {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
classifierStorage.preCacheTypeParameters(fir)
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class IrAnonymousInitializerImpl(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrAnonymousInitializerSymbol,
|
||||
override val isStatic: Boolean = false
|
||||
) : IrAnonymousInitializer {
|
||||
) : IrAnonymousInitializer() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ class IrClassImpl(
|
||||
override val isExpect: Boolean = false,
|
||||
override val isFun: Boolean = false,
|
||||
override val source: SourceElement = SourceElement.NO_SOURCE
|
||||
) : IrClass {
|
||||
) : IrClass() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class IrConstructorImpl(
|
||||
override val isExternal: Boolean,
|
||||
override val isPrimary: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
) : IrConstructor {
|
||||
) : IrConstructor() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ class IrEnumEntryImpl(
|
||||
override var origin: IrDeclarationOrigin,
|
||||
override val symbol: IrEnumEntrySymbol,
|
||||
override val name: Name
|
||||
) : IrEnumEntry {
|
||||
) : IrEnumEntry() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ class IrErrorDeclarationImpl(
|
||||
override val startOffset: Int,
|
||||
override val endOffset: Int,
|
||||
override val descriptor: DeclarationDescriptor
|
||||
) : IrErrorDeclaration {
|
||||
) : IrErrorDeclaration() {
|
||||
override var origin: IrDeclarationOrigin = IrDeclarationOrigin.DEFINED
|
||||
|
||||
override val factory: IrFactory
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class IrFieldImpl(
|
||||
override val isFinal: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isStatic: Boolean,
|
||||
) : IrField {
|
||||
) : IrField() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ abstract class IrFunctionCommonImpl(
|
||||
override val isOperator: Boolean,
|
||||
override val isInfix: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
) : IrSimpleFunction {
|
||||
) : IrSimpleFunction() {
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class IrLocalDelegatedPropertyImpl(
|
||||
override val name: Name,
|
||||
override val type: IrType,
|
||||
override val isVar: Boolean
|
||||
) : IrLocalDelegatedProperty {
|
||||
) : IrLocalDelegatedProperty() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ abstract class IrPropertyCommonImpl(
|
||||
override val isDelegated: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
) : IrProperty {
|
||||
) : IrProperty() {
|
||||
override val factory: IrFactory
|
||||
get() = IrFactoryImpl
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ class IrTypeAliasImpl(
|
||||
override val expandedType: IrType,
|
||||
override val isActual: Boolean,
|
||||
override var origin: IrDeclarationOrigin
|
||||
) : IrTypeAlias {
|
||||
) : IrTypeAlias() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class IrTypeParameterImpl(
|
||||
override val index: Int,
|
||||
override val isReified: Boolean,
|
||||
override val variance: Variance
|
||||
) : IrTypeParameter {
|
||||
) : IrTypeParameter() {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ class IrValueParameterImpl(
|
||||
override val varargElementType: IrType?,
|
||||
override val isCrossinline: Boolean,
|
||||
override val isNoinline: Boolean
|
||||
) : IrValueParameter {
|
||||
) : IrValueParameter() {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ParameterDescriptor
|
||||
get() = symbol.descriptor
|
||||
|
||||
+2
-2
@@ -34,8 +34,8 @@ internal class PersistentIrAnonymousInitializer(
|
||||
origin: IrDeclarationOrigin,
|
||||
override val symbol: IrAnonymousInitializerSymbol,
|
||||
override val isStatic: Boolean = false
|
||||
) : PersistentIrDeclarationBase<AnonymousInitializerCarrier>,
|
||||
IrAnonymousInitializer,
|
||||
) : IrAnonymousInitializer(),
|
||||
PersistentIrDeclarationBase<AnonymousInitializerCarrier>,
|
||||
AnonymousInitializerCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+1
-2
@@ -44,9 +44,8 @@ internal class PersistentIrClass(
|
||||
override val isExpect: Boolean = false,
|
||||
override val isFun: Boolean = false,
|
||||
override val source: SourceElement = SourceElement.NO_SOURCE
|
||||
) :
|
||||
) : IrClass(),
|
||||
PersistentIrDeclarationBase<ClassCarrier>,
|
||||
IrClass,
|
||||
ClassCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+1
-2
@@ -40,9 +40,8 @@ internal class PersistentIrConstructor(
|
||||
override val isExternal: Boolean,
|
||||
override val isPrimary: Boolean,
|
||||
override val isExpect: Boolean
|
||||
) :
|
||||
) : IrConstructor(),
|
||||
PersistentIrDeclarationBase<ConstructorCarrier>,
|
||||
IrConstructor,
|
||||
ConstructorCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+2
-2
@@ -32,8 +32,8 @@ internal class PersistentIrEnumEntry(
|
||||
origin: IrDeclarationOrigin,
|
||||
override val symbol: IrEnumEntrySymbol,
|
||||
override val name: Name
|
||||
) : PersistentIrDeclarationBase<EnumEntryCarrier>,
|
||||
IrEnumEntry,
|
||||
) : IrEnumEntry(),
|
||||
PersistentIrDeclarationBase<EnumEntryCarrier>,
|
||||
EnumEntryCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ internal class PersistentIrErrorDeclaration(
|
||||
override val startOffset: Int,
|
||||
override val endOffset: Int,
|
||||
override val descriptor: DeclarationDescriptor
|
||||
) : PersistentIrDeclarationBase<ErrorCarrier>, IrErrorDeclaration, ErrorCarrier {
|
||||
) : PersistentIrDeclarationBase<ErrorCarrier>, IrErrorDeclaration(), ErrorCarrier {
|
||||
override var lastModified: Int = stageController.currentStage
|
||||
override var loweredUpTo: Int = stageController.currentStage
|
||||
override var values: Array<Carrier>? = null
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ internal class PersistentIrField(
|
||||
override val isFinal: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isStatic: Boolean
|
||||
) : PersistentIrDeclarationBase<FieldCarrier>,
|
||||
IrField,
|
||||
) : IrField(),
|
||||
PersistentIrDeclarationBase<FieldCarrier>,
|
||||
FieldCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+1
-2
@@ -34,9 +34,8 @@ internal abstract class PersistentIrFunctionCommon(
|
||||
override val isOperator: Boolean,
|
||||
override val isInfix: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
) :
|
||||
) : IrSimpleFunction(),
|
||||
PersistentIrDeclarationBase<FunctionCarrier>,
|
||||
IrSimpleFunction,
|
||||
FunctionCarrier {
|
||||
|
||||
override var lastModified: Int = stageController.currentStage
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ internal class PersistentIrLocalDelegatedProperty(
|
||||
override val isVar: Boolean
|
||||
) :
|
||||
PersistentIrDeclarationBase<LocalDelegatedPropertyCarrier>,
|
||||
IrLocalDelegatedProperty,
|
||||
IrLocalDelegatedProperty(),
|
||||
LocalDelegatedPropertyCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+2
-2
@@ -40,8 +40,8 @@ internal abstract class PersistentIrPropertyCommon(
|
||||
override val isDelegated: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val isExpect: Boolean,
|
||||
) : PersistentIrDeclarationBase<PropertyCarrier>,
|
||||
IrProperty,
|
||||
) : IrProperty(),
|
||||
PersistentIrDeclarationBase<PropertyCarrier>,
|
||||
PropertyCarrier {
|
||||
|
||||
override var lastModified: Int = stageController.currentStage
|
||||
|
||||
+1
-2
@@ -25,9 +25,8 @@ internal class PersistentIrTypeAlias(
|
||||
override val expandedType: IrType,
|
||||
override val isActual: Boolean,
|
||||
origin: IrDeclarationOrigin
|
||||
) :
|
||||
) : IrTypeAlias(),
|
||||
PersistentIrDeclarationBase<TypeAliasCarrier>,
|
||||
IrTypeAlias,
|
||||
TypeAliasCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+1
-2
@@ -40,9 +40,8 @@ internal class PersistentIrTypeParameter(
|
||||
override val index: Int,
|
||||
override val isReified: Boolean,
|
||||
override val variance: Variance
|
||||
) :
|
||||
) : IrTypeParameter(),
|
||||
PersistentIrDeclarationBase<TypeParameterCarrier>,
|
||||
IrTypeParameter,
|
||||
TypeParameterCarrier {
|
||||
|
||||
init {
|
||||
|
||||
+1
-2
@@ -41,9 +41,8 @@ internal class PersistentIrValueParameter(
|
||||
override val varargElementType: IrType?,
|
||||
override val isCrossinline: Boolean,
|
||||
override val isNoinline: Boolean
|
||||
) :
|
||||
) : IrValueParameter(),
|
||||
PersistentIrDeclarationBase<ValueParameterCarrier>,
|
||||
IrValueParameter,
|
||||
ValueParameterCarrier {
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
|
||||
+5
-4
@@ -23,12 +23,13 @@ import org.jetbrains.kotlin.ir.symbols.IrAnonymousInitializerSymbol
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrAnonymousInitializer : IrSymbolDeclaration<IrAnonymousInitializerSymbol> {
|
||||
abstract class IrAnonymousInitializer : IrSymbolDeclaration<IrAnonymousInitializerSymbol> {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ClassDescriptor // TODO special descriptor for anonymous initializer blocks
|
||||
val isStatic: Boolean
|
||||
abstract override val descriptor: ClassDescriptor // TODO special descriptor for anonymous initializer blocks
|
||||
|
||||
var body: IrBlockBody
|
||||
abstract val isStatic: Boolean
|
||||
|
||||
abstract var body: IrBlockBody
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitAnonymousInitializer(this, data)
|
||||
|
||||
@@ -28,28 +28,28 @@ import org.jetbrains.kotlin.ir.util.transformIfNeeded
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrClass :
|
||||
abstract class IrClass :
|
||||
IrSymbolDeclaration<IrClassSymbol>, IrDeclarationWithName, IrDeclarationWithVisibility,
|
||||
IrDeclarationContainer, IrTypeParametersContainer, IrAttributeContainer, IrMetadataSourceOwner {
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ClassDescriptor
|
||||
abstract override val descriptor: ClassDescriptor
|
||||
|
||||
val kind: ClassKind
|
||||
var modality: Modality
|
||||
val isCompanion: Boolean
|
||||
val isInner: Boolean
|
||||
val isData: Boolean
|
||||
val isExternal: Boolean
|
||||
val isInline: Boolean
|
||||
val isExpect: Boolean
|
||||
val isFun: Boolean
|
||||
abstract val kind: ClassKind
|
||||
abstract var modality: Modality
|
||||
abstract val isCompanion: Boolean
|
||||
abstract val isInner: Boolean
|
||||
abstract val isData: Boolean
|
||||
abstract val isExternal: Boolean
|
||||
abstract val isInline: Boolean
|
||||
abstract val isExpect: Boolean
|
||||
abstract val isFun: Boolean
|
||||
|
||||
val source: SourceElement
|
||||
abstract val source: SourceElement
|
||||
|
||||
var superTypes: List<IrType>
|
||||
abstract var superTypes: List<IrType>
|
||||
|
||||
var thisReceiver: IrValueParameter?
|
||||
abstract var thisReceiver: IrValueParameter?
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitClass(this, data)
|
||||
|
||||
@@ -21,11 +21,11 @@ import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrConstructor : IrFunction, IrSymbolDeclaration<IrConstructorSymbol> {
|
||||
abstract class IrConstructor : IrFunction(), IrSymbolDeclaration<IrConstructorSymbol> {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ClassConstructorDescriptor
|
||||
abstract override val descriptor: ClassConstructorDescriptor
|
||||
|
||||
val isPrimary: Boolean
|
||||
abstract val isPrimary: Boolean
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitConstructor(this, data)
|
||||
|
||||
@@ -23,12 +23,12 @@ import org.jetbrains.kotlin.ir.symbols.IrEnumEntrySymbol
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrEnumEntry : IrSymbolDeclaration<IrEnumEntrySymbol>, IrDeclarationWithName {
|
||||
abstract class IrEnumEntry : IrSymbolDeclaration<IrEnumEntrySymbol>, IrDeclarationWithName {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ClassDescriptor
|
||||
abstract override val descriptor: ClassDescriptor
|
||||
|
||||
var correspondingClass: IrClass?
|
||||
var initializerExpression: IrExpressionBody?
|
||||
abstract var correspondingClass: IrClass?
|
||||
abstract var initializerExpression: IrExpressionBody?
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitEnumEntry(this, data)
|
||||
|
||||
@@ -19,7 +19,7 @@ package org.jetbrains.kotlin.ir.declarations
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrErrorDeclaration : IrDeclaration {
|
||||
abstract class IrErrorDeclaration : IrDeclaration {
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitErrorDeclaration(this, data)
|
||||
|
||||
|
||||
@@ -14,21 +14,21 @@ import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrField :
|
||||
abstract class IrField :
|
||||
IrSymbolDeclaration<IrFieldSymbol>,
|
||||
IrDeclarationWithName, IrDeclarationWithVisibility, IrDeclarationParent, IrMetadataSourceOwner {
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: PropertyDescriptor
|
||||
abstract override val descriptor: PropertyDescriptor
|
||||
|
||||
val type: IrType
|
||||
val isFinal: Boolean
|
||||
val isExternal: Boolean
|
||||
val isStatic: Boolean
|
||||
abstract val type: IrType
|
||||
abstract val isFinal: Boolean
|
||||
abstract val isExternal: Boolean
|
||||
abstract val isStatic: Boolean
|
||||
|
||||
var initializer: IrExpressionBody?
|
||||
abstract var initializer: IrExpressionBody?
|
||||
|
||||
var correspondingPropertySymbol: IrPropertySymbol?
|
||||
abstract var correspondingPropertySymbol: IrPropertySymbol?
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitField(this, data)
|
||||
|
||||
@@ -27,25 +27,25 @@ import org.jetbrains.kotlin.ir.util.transformIfNeeded
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrFunction :
|
||||
abstract class IrFunction :
|
||||
IrDeclarationWithName, IrDeclarationWithVisibility, IrTypeParametersContainer, IrSymbolOwner, IrDeclarationParent, IrReturnTarget,
|
||||
IrMetadataSourceOwner {
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: FunctionDescriptor
|
||||
override val symbol: IrFunctionSymbol
|
||||
abstract override val descriptor: FunctionDescriptor
|
||||
abstract override val symbol: IrFunctionSymbol
|
||||
|
||||
val isInline: Boolean // NB: there's an inline constructor for Array and each primitive array class
|
||||
val isExternal: Boolean
|
||||
val isExpect: Boolean
|
||||
abstract val isInline: Boolean // NB: there's an inline constructor for Array and each primitive array class
|
||||
abstract val isExternal: Boolean
|
||||
abstract val isExpect: Boolean
|
||||
|
||||
var returnType: IrType
|
||||
abstract var returnType: IrType
|
||||
|
||||
var dispatchReceiverParameter: IrValueParameter?
|
||||
var extensionReceiverParameter: IrValueParameter?
|
||||
var valueParameters: List<IrValueParameter>
|
||||
abstract var dispatchReceiverParameter: IrValueParameter?
|
||||
abstract var extensionReceiverParameter: IrValueParameter?
|
||||
abstract var valueParameters: List<IrValueParameter>
|
||||
|
||||
var body: IrBody?
|
||||
abstract var body: IrBody?
|
||||
|
||||
override fun <D> acceptChildren(visitor: IrElementVisitor<Unit, D>, data: D) {
|
||||
typeParameters.forEach { it.accept(visitor, data) }
|
||||
|
||||
+8
-8
@@ -23,21 +23,21 @@ import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrLocalDelegatedProperty :
|
||||
abstract class IrLocalDelegatedProperty :
|
||||
IrDeclarationWithName,
|
||||
IrSymbolOwner,
|
||||
IrMetadataSourceOwner {
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: VariableDescriptorWithAccessors
|
||||
override val symbol: IrLocalDelegatedPropertySymbol
|
||||
abstract override val descriptor: VariableDescriptorWithAccessors
|
||||
abstract override val symbol: IrLocalDelegatedPropertySymbol
|
||||
|
||||
val type: IrType
|
||||
val isVar: Boolean
|
||||
abstract val type: IrType
|
||||
abstract val isVar: Boolean
|
||||
|
||||
var delegate: IrVariable
|
||||
var getter: IrFunction
|
||||
var setter: IrFunction?
|
||||
abstract var delegate: IrVariable
|
||||
abstract var getter: IrFunction
|
||||
abstract var setter: IrFunction?
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitLocalDelegatedProperty(this, data)
|
||||
|
||||
@@ -22,22 +22,22 @@ import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrProperty : IrOverridableMember, IrMetadataSourceOwner {
|
||||
abstract class IrProperty : IrOverridableMember, IrMetadataSourceOwner {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: PropertyDescriptor
|
||||
override val symbol: IrPropertySymbol
|
||||
abstract override val descriptor: PropertyDescriptor
|
||||
abstract override val symbol: IrPropertySymbol
|
||||
|
||||
val isVar: Boolean
|
||||
val isConst: Boolean
|
||||
val isLateinit: Boolean
|
||||
val isDelegated: Boolean
|
||||
val isExternal: Boolean
|
||||
val isExpect: Boolean
|
||||
val isFakeOverride: Boolean
|
||||
abstract val isVar: Boolean
|
||||
abstract val isConst: Boolean
|
||||
abstract val isLateinit: Boolean
|
||||
abstract val isDelegated: Boolean
|
||||
abstract val isExternal: Boolean
|
||||
abstract val isExpect: Boolean
|
||||
abstract val isFakeOverride: Boolean
|
||||
|
||||
var backingField: IrField?
|
||||
var getter: IrSimpleFunction?
|
||||
var setter: IrSimpleFunction?
|
||||
abstract var backingField: IrField?
|
||||
abstract var getter: IrSimpleFunction?
|
||||
abstract var setter: IrSimpleFunction?
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitProperty(this, data)
|
||||
|
||||
@@ -10,9 +10,9 @@ import org.jetbrains.kotlin.ir.symbols.IrScriptSymbol
|
||||
|
||||
//TODO: make IrScript as IrPackageFragment, because script is used as a file, not as a class
|
||||
//NOTE: declarations and statements stored separately
|
||||
interface IrScript : IrSymbolDeclaration<IrScriptSymbol>, IrDeclarationContainer, IrDeclarationWithName, IrDeclarationParent {
|
||||
val statements: MutableList<IrStatement>
|
||||
abstract class IrScript : IrSymbolDeclaration<IrScriptSymbol>, IrDeclarationContainer, IrDeclarationWithName, IrDeclarationParent {
|
||||
abstract val statements: MutableList<IrStatement>
|
||||
|
||||
// NOTE: is the result of the FE conversion, because there script interpreted as a class and has receiver
|
||||
var thisReceiver: IrValueParameter
|
||||
abstract var thisReceiver: IrValueParameter
|
||||
}
|
||||
|
||||
@@ -9,20 +9,20 @@ import org.jetbrains.kotlin.ir.symbols.IrPropertySymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrSimpleFunction :
|
||||
IrFunction,
|
||||
abstract class IrSimpleFunction :
|
||||
IrFunction(),
|
||||
IrSymbolDeclaration<IrSimpleFunctionSymbol>,
|
||||
IrOverridableDeclaration<IrSimpleFunctionSymbol>,
|
||||
IrOverridableMember,
|
||||
IrAttributeContainer {
|
||||
|
||||
val isTailrec: Boolean
|
||||
val isSuspend: Boolean
|
||||
val isFakeOverride: Boolean
|
||||
val isOperator: Boolean
|
||||
val isInfix: Boolean
|
||||
abstract val isTailrec: Boolean
|
||||
abstract val isSuspend: Boolean
|
||||
abstract val isFakeOverride: Boolean
|
||||
abstract val isOperator: Boolean
|
||||
abstract val isInfix: Boolean
|
||||
|
||||
var correspondingPropertySymbol: IrPropertySymbol?
|
||||
abstract var correspondingPropertySymbol: IrPropertySymbol?
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitSimpleFunction(this, data)
|
||||
|
||||
@@ -13,17 +13,17 @@ import org.jetbrains.kotlin.ir.util.transformIfNeeded
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrTypeAlias :
|
||||
abstract class IrTypeAlias :
|
||||
IrSymbolDeclaration<IrTypeAliasSymbol>,
|
||||
IrDeclarationWithName,
|
||||
IrDeclarationWithVisibility,
|
||||
IrTypeParametersContainer {
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: TypeAliasDescriptor
|
||||
abstract override val descriptor: TypeAliasDescriptor
|
||||
|
||||
val isActual: Boolean
|
||||
val expandedType: IrType
|
||||
abstract val isActual: Boolean
|
||||
abstract val expandedType: IrType
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitTypeAlias(this, data)
|
||||
|
||||
@@ -24,14 +24,14 @@ import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
interface IrTypeParameter : IrSymbolDeclaration<IrTypeParameterSymbol>, IrDeclarationWithName {
|
||||
abstract class IrTypeParameter : IrSymbolDeclaration<IrTypeParameterSymbol>, IrDeclarationWithName {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: TypeParameterDescriptor
|
||||
abstract override val descriptor: TypeParameterDescriptor
|
||||
|
||||
val variance: Variance
|
||||
val index: Int
|
||||
val isReified: Boolean
|
||||
val superTypes: MutableList<IrType>
|
||||
abstract val variance: Variance
|
||||
abstract val index: Int
|
||||
abstract val isReified: Boolean
|
||||
abstract val superTypes: MutableList<IrType>
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitTypeParameter(this, data)
|
||||
|
||||
@@ -10,10 +10,10 @@ import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.symbols.IrValueSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
|
||||
interface IrValueDeclaration : IrDeclarationWithName, IrSymbolOwner {
|
||||
abstract class IrValueDeclaration : IrDeclarationWithName, IrSymbolOwner {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ValueDescriptor
|
||||
abstract override val descriptor: ValueDescriptor
|
||||
|
||||
override val symbol: IrValueSymbol
|
||||
val type: IrType
|
||||
}
|
||||
abstract override val symbol: IrValueSymbol
|
||||
abstract val type: IrType
|
||||
}
|
||||
|
||||
@@ -24,16 +24,16 @@ import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
interface IrValueParameter : IrValueDeclaration, IrSymbolDeclaration<IrValueParameterSymbol> {
|
||||
abstract class IrValueParameter : IrValueDeclaration(), IrSymbolDeclaration<IrValueParameterSymbol> {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ParameterDescriptor
|
||||
abstract override val descriptor: ParameterDescriptor
|
||||
|
||||
val index: Int
|
||||
val varargElementType: IrType?
|
||||
val isCrossinline: Boolean
|
||||
val isNoinline: Boolean
|
||||
abstract val index: Int
|
||||
abstract val varargElementType: IrType?
|
||||
abstract val isCrossinline: Boolean
|
||||
abstract val isNoinline: Boolean
|
||||
|
||||
var defaultValue: IrExpressionBody?
|
||||
abstract var defaultValue: IrExpressionBody?
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitValueParameter(this, data)
|
||||
|
||||
@@ -21,14 +21,13 @@ import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol
|
||||
|
||||
interface IrVariable : IrValueDeclaration, IrSymbolDeclaration<IrVariableSymbol> {
|
||||
abstract class IrVariable : IrValueDeclaration(), IrSymbolDeclaration<IrVariableSymbol> {
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: VariableDescriptor
|
||||
abstract override val descriptor: VariableDescriptor
|
||||
|
||||
val isVar: Boolean
|
||||
val isConst: Boolean
|
||||
val isLateinit: Boolean
|
||||
abstract val isVar: Boolean
|
||||
abstract val isConst: Boolean
|
||||
abstract val isLateinit: Boolean
|
||||
|
||||
var initializer: IrExpression?
|
||||
abstract var initializer: IrExpression?
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ private val SCRIPT_ORIGIN = object : IrDeclarationOriginImpl("FIELD_FOR_OBJECT_I
|
||||
class IrScriptImpl(
|
||||
override val symbol: IrScriptSymbol,
|
||||
override val name: Name
|
||||
) : IrScript, IrDeclaration {
|
||||
) : IrScript() {
|
||||
override val startOffset: Int get() = UNDEFINED_OFFSET
|
||||
override val endOffset: Int get() = UNDEFINED_OFFSET
|
||||
override var origin: IrDeclarationOrigin = SCRIPT_ORIGIN
|
||||
@@ -44,7 +44,8 @@ class IrScriptImpl(
|
||||
override lateinit var thisReceiver: IrValueParameter
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: ScriptDescriptor = symbol.descriptor
|
||||
override val descriptor: ScriptDescriptor
|
||||
get() = symbol.descriptor
|
||||
|
||||
override val factory: IrFactory
|
||||
get() = error("Create IrScriptImpl directly")
|
||||
|
||||
@@ -40,8 +40,7 @@ class IrVariableImpl(
|
||||
override val isVar: Boolean,
|
||||
override val isConst: Boolean,
|
||||
override val isLateinit: Boolean
|
||||
) : IrVariable {
|
||||
|
||||
) : IrVariable() {
|
||||
private var _parent: IrDeclarationParent? = null
|
||||
override var parent: IrDeclarationParent
|
||||
get() = _parent
|
||||
@@ -57,7 +56,8 @@ class IrVariableImpl(
|
||||
}
|
||||
|
||||
@ObsoleteDescriptorBasedAPI
|
||||
override val descriptor: VariableDescriptor get() = symbol.descriptor
|
||||
override val descriptor: VariableDescriptor
|
||||
get() = symbol.descriptor
|
||||
|
||||
override var initializer: IrExpression? = null
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class IrLazyClass(
|
||||
override val isFun: Boolean,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator
|
||||
) : IrClass, IrLazyDeclarationBase {
|
||||
) : IrClass(), IrLazyDeclarationBase {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ class IrLazyConstructor(
|
||||
override val isExpect: Boolean,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
) : IrConstructor, IrLazyFunctionBase {
|
||||
) : IrConstructor(), IrLazyFunctionBase {
|
||||
override var parent: IrDeclarationParent by createLazyParent()
|
||||
|
||||
override var annotations: List<IrConstructorCall> by createLazyAnnotations()
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ class IrLazyEnumEntryImpl(
|
||||
override val descriptor: ClassDescriptor,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
) : IrEnumEntry, IrLazyDeclarationBase {
|
||||
) : IrEnumEntry(), IrLazyDeclarationBase {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class IrLazyField(
|
||||
override val isStatic: Boolean,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
) : IrField, IrLazyDeclarationBase {
|
||||
) : IrField(), IrLazyDeclarationBase {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class IrLazyFunction(
|
||||
override val isInfix: Boolean,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
) : IrSimpleFunction, IrLazyFunctionBase {
|
||||
) : IrSimpleFunction(), IrLazyFunctionBase {
|
||||
override var parent: IrDeclarationParent by createLazyParent()
|
||||
|
||||
override var annotations: List<IrConstructorCall> by createLazyAnnotations()
|
||||
|
||||
@@ -38,7 +38,7 @@ class IrLazyProperty(
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
bindingContext: BindingContext? = null
|
||||
) : IrProperty, IrLazyDeclarationBase {
|
||||
) : IrProperty(), IrLazyDeclarationBase {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class IrLazyTypeAlias(
|
||||
override val isActual: Boolean,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
) : IrTypeAlias, IrLazyDeclarationBase {
|
||||
) : IrTypeAlias(), IrLazyDeclarationBase {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ class IrLazyTypeParameter(
|
||||
override val variance: Variance,
|
||||
override val stubGenerator: DeclarationStubGenerator,
|
||||
override val typeTranslator: TypeTranslator,
|
||||
) : IrTypeParameter, IrLazyDeclarationBase {
|
||||
) : IrTypeParameter(), IrLazyDeclarationBase {
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user