IR declarations: KotlinType -> IrType
This commit is contained in:
@@ -36,6 +36,7 @@ interface IrClass : IrSymbolDeclaration<IrClassSymbol>, IrDeclarationContainer,
|
||||
val isExternal: Boolean
|
||||
|
||||
// NB type parameters can't be top-level classifiers in supetypes of a class
|
||||
// TODO val superTypes: MutableList<IrType>
|
||||
val superClasses: MutableList<IrClassSymbol>
|
||||
|
||||
var thisReceiver: IrValueParameter?
|
||||
|
||||
@@ -9,14 +9,14 @@ import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFieldSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
interface IrField : IrSymbolDeclaration<IrFieldSymbol> {
|
||||
override val descriptor: PropertyDescriptor
|
||||
|
||||
val name: Name
|
||||
val type: KotlinType
|
||||
val type: IrType
|
||||
val visibility: Visibility
|
||||
val isFinal: Boolean
|
||||
val isExternal: Boolean
|
||||
|
||||
@@ -23,7 +23,7 @@ import org.jetbrains.kotlin.ir.expressions.IrBody
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||
import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
|
||||
interface IrFunction : IrDeclaration, IrTypeParametersContainer, IrSymbolOwner, IrDeclarationParent, IrReturnTarget {
|
||||
override val descriptor: FunctionDescriptor
|
||||
@@ -33,7 +33,7 @@ interface IrFunction : IrDeclaration, IrTypeParametersContainer, IrSymbolOwner,
|
||||
val visibility: Visibility
|
||||
val isInline: Boolean // NB: there's an inline constructor for Array and each primitive array class
|
||||
val isExternal: Boolean
|
||||
val returnType: KotlinType
|
||||
val returnType: IrType
|
||||
|
||||
var dispatchReceiverParameter: IrValueParameter?
|
||||
var extensionReceiverParameter: IrValueParameter?
|
||||
|
||||
+2
-2
@@ -17,14 +17,14 @@
|
||||
package org.jetbrains.kotlin.ir.declarations
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.VariableDescriptorWithAccessors
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
interface IrLocalDelegatedProperty : IrDeclaration {
|
||||
override val descriptor: VariableDescriptorWithAccessors
|
||||
|
||||
val name: Name
|
||||
val type: KotlinType
|
||||
val type: IrType
|
||||
val isVar: Boolean
|
||||
|
||||
var delegate: IrVariable
|
||||
|
||||
@@ -19,14 +19,14 @@ package org.jetbrains.kotlin.ir.declarations
|
||||
import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
interface IrProperty : IrDeclaration {
|
||||
override val descriptor: PropertyDescriptor
|
||||
|
||||
val name: Name
|
||||
val type: KotlinType
|
||||
val type: IrType
|
||||
val modality: Modality
|
||||
val visibility: Visibility
|
||||
val isVar: Boolean
|
||||
|
||||
@@ -19,9 +19,9 @@ package org.jetbrains.kotlin.ir.declarations
|
||||
import org.jetbrains.kotlin.descriptors.TypeParameterDescriptor
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
|
||||
interface IrTypeParameter : IrSymbolDeclaration<IrTypeParameterSymbol> {
|
||||
@@ -30,7 +30,7 @@ interface IrTypeParameter : IrSymbolDeclaration<IrTypeParameterSymbol> {
|
||||
val name: Name
|
||||
val variance: Variance
|
||||
val index: Int
|
||||
val upperBounds: List<KotlinType>
|
||||
val upperBounds: List<IrType>
|
||||
|
||||
val superClassifiers: MutableList<IrClassifierSymbol>
|
||||
|
||||
|
||||
@@ -19,14 +19,14 @@ 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.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
interface IrValueParameter : IrValueDeclaration, IrSymbolDeclaration<IrValueParameterSymbol> {
|
||||
override val descriptor: ParameterDescriptor
|
||||
|
||||
val index: Int
|
||||
val varargElementType: KotlinType?
|
||||
val varargElementType: IrType?
|
||||
val isCrossinline: Boolean
|
||||
val isNoinline: Boolean
|
||||
|
||||
|
||||
+9
-6
@@ -23,10 +23,10 @@ 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.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
class IrConstructorImpl(
|
||||
startOffset: Int,
|
||||
@@ -35,7 +35,7 @@ class IrConstructorImpl(
|
||||
override val symbol: IrConstructorSymbol,
|
||||
name: Name,
|
||||
visibility: Visibility,
|
||||
returnType: KotlinType,
|
||||
returnType: IrType,
|
||||
isInline: Boolean,
|
||||
isExternal: Boolean,
|
||||
override val isPrimary: Boolean
|
||||
@@ -51,12 +51,13 @@ class IrConstructorImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrConstructorSymbol,
|
||||
returnType: IrType,
|
||||
body: IrBody? = null
|
||||
) : this(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
symbol.descriptor.name,
|
||||
symbol.descriptor.visibility,
|
||||
symbol.descriptor.returnType,
|
||||
returnType,
|
||||
symbol.descriptor.isInline,
|
||||
symbol.descriptor.isEffectivelyExternal(),
|
||||
symbol.descriptor.isPrimary
|
||||
@@ -68,8 +69,9 @@ class IrConstructorImpl(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: ClassConstructorDescriptor
|
||||
) : this(startOffset, endOffset, origin, IrConstructorSymbolImpl(descriptor))
|
||||
descriptor: ClassConstructorDescriptor,
|
||||
returnType: IrType
|
||||
) : this(startOffset, endOffset, origin, IrConstructorSymbolImpl(descriptor), returnType)
|
||||
|
||||
@Deprecated("Let use constructor which takes symbol instead of descriptor")
|
||||
constructor(
|
||||
@@ -77,8 +79,9 @@ class IrConstructorImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: ClassConstructorDescriptor,
|
||||
returnType: IrType,
|
||||
body: IrBody?
|
||||
) : this(startOffset, endOffset, origin, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, descriptor, returnType) {
|
||||
this.body = body
|
||||
}
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ import org.jetbrains.kotlin.ir.declarations.IrField
|
||||
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.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
|
||||
class IrFieldImpl(
|
||||
@@ -36,34 +36,44 @@ class IrFieldImpl(
|
||||
origin: IrDeclarationOrigin,
|
||||
override val symbol: IrFieldSymbol,
|
||||
override val name: Name,
|
||||
override val type: KotlinType,
|
||||
override val type: IrType,
|
||||
override val visibility: Visibility,
|
||||
override val isFinal: Boolean,
|
||||
override val isExternal: Boolean
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin), IrField {
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrField {
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrFieldSymbol,
|
||||
initializer: IrExpressionBody? = null
|
||||
) : this(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
symbol.descriptor.name, symbol.descriptor.type, symbol.descriptor.visibility,
|
||||
!symbol.descriptor.isVar,
|
||||
symbol.descriptor.isEffectivelyExternal()
|
||||
) {
|
||||
this.initializer = initializer
|
||||
}
|
||||
|
||||
constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: PropertyDescriptor) :
|
||||
this(startOffset, endOffset, origin, IrFieldSymbolImpl(descriptor))
|
||||
type: IrType
|
||||
) :
|
||||
this(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
symbol.descriptor.name, type, symbol.descriptor.visibility,
|
||||
!symbol.descriptor.isVar,
|
||||
symbol.descriptor.isEffectivelyExternal()
|
||||
)
|
||||
|
||||
constructor(
|
||||
startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: PropertyDescriptor,
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType
|
||||
) :
|
||||
this(startOffset, endOffset, origin, IrFieldSymbolImpl(descriptor), type)
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType,
|
||||
initializer: IrExpressionBody?
|
||||
) : this(startOffset, endOffset, origin, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, descriptor, type) {
|
||||
this.initializer = initializer
|
||||
}
|
||||
|
||||
|
||||
@@ -34,7 +34,9 @@ class IrFileImpl(
|
||||
override val fileEntry: SourceManager.FileEntry,
|
||||
override val symbol: IrFileSymbol,
|
||||
override val fqName: FqName
|
||||
) : IrElementBase(0, fileEntry.maxOffset), IrFile {
|
||||
) :
|
||||
IrElementBase(0, fileEntry.maxOffset),
|
||||
IrFile {
|
||||
|
||||
constructor(fileEntry: SourceManager.FileEntry, symbol: IrFileSymbol) :
|
||||
this(fileEntry, symbol, symbol.descriptor.fqName)
|
||||
|
||||
@@ -22,11 +22,11 @@ import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.ir.expressions.IrBody
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.util.transform
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
|
||||
abstract class IrFunctionBase(
|
||||
@@ -37,8 +37,10 @@ abstract class IrFunctionBase(
|
||||
override val visibility: Visibility,
|
||||
override val isInline: Boolean,
|
||||
override val isExternal: Boolean,
|
||||
override val returnType: KotlinType
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin), IrFunction {
|
||||
override val returnType: IrType
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrFunction {
|
||||
|
||||
override val typeParameters: MutableList<IrTypeParameter> = SmartList()
|
||||
|
||||
override var dispatchReceiverParameter: IrValueParameter? = null
|
||||
|
||||
+33
-12
@@ -25,9 +25,9 @@ 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.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
|
||||
class IrFunctionImpl(
|
||||
@@ -35,18 +35,36 @@ class IrFunctionImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
override val symbol: IrSimpleFunctionSymbol,
|
||||
name: Name = symbol.descriptor.name,
|
||||
visibility: Visibility = symbol.descriptor.visibility,
|
||||
override val modality: Modality = symbol.descriptor.modality,
|
||||
returnType: KotlinType = symbol.descriptor.returnType!!,
|
||||
isInline: Boolean = symbol.descriptor.isInline,
|
||||
isExternal: Boolean = symbol.descriptor.isExternal,
|
||||
override val isTailrec: Boolean = symbol.descriptor.isTailrec,
|
||||
override val isSuspend: Boolean = symbol.descriptor.isSuspend
|
||||
name: Name,
|
||||
visibility: Visibility,
|
||||
override val modality: Modality,
|
||||
returnType: IrType,
|
||||
isInline: Boolean,
|
||||
isExternal: Boolean,
|
||||
override val isTailrec: Boolean,
|
||||
override val isSuspend: Boolean
|
||||
) :
|
||||
IrFunctionBase(startOffset, endOffset, origin, name, visibility, isInline, isExternal, returnType),
|
||||
IrSimpleFunction {
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrSimpleFunctionSymbol,
|
||||
returnType: IrType
|
||||
) : this(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
symbol.descriptor.name,
|
||||
symbol.descriptor.visibility,
|
||||
symbol.descriptor.modality,
|
||||
returnType,
|
||||
symbol.descriptor.isInline,
|
||||
symbol.descriptor.isExternal,
|
||||
symbol.descriptor.isTailrec,
|
||||
symbol.descriptor.isSuspend
|
||||
)
|
||||
|
||||
override val descriptor: FunctionDescriptor = symbol.descriptor
|
||||
|
||||
override val overriddenSymbols: MutableList<IrSimpleFunctionSymbol> = SmartList()
|
||||
@@ -57,10 +75,12 @@ class IrFunctionImpl(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: FunctionDescriptor
|
||||
descriptor: FunctionDescriptor,
|
||||
returnType: IrType
|
||||
) : this(
|
||||
startOffset, endOffset, origin,
|
||||
IrSimpleFunctionSymbolImpl(descriptor)
|
||||
IrSimpleFunctionSymbolImpl(descriptor),
|
||||
returnType
|
||||
)
|
||||
|
||||
constructor(
|
||||
@@ -68,8 +88,9 @@ class IrFunctionImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: FunctionDescriptor,
|
||||
returnType: IrType,
|
||||
body: IrBody?
|
||||
) : this(startOffset, endOffset, origin, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, descriptor, returnType) {
|
||||
this.body = body
|
||||
}
|
||||
|
||||
|
||||
+11
-7
@@ -21,10 +21,10 @@ import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrLocalDelegatedProperty
|
||||
import org.jetbrains.kotlin.ir.declarations.IrVariable
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
class IrLocalDelegatedPropertyImpl(
|
||||
startOffset: Int,
|
||||
@@ -32,19 +32,21 @@ class IrLocalDelegatedPropertyImpl(
|
||||
origin: IrDeclarationOrigin,
|
||||
override val descriptor: VariableDescriptorWithAccessors,
|
||||
override val name: Name,
|
||||
override val type: KotlinType,
|
||||
override val type: IrType,
|
||||
override val isVar: Boolean
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin),
|
||||
) :
|
||||
IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrLocalDelegatedProperty {
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: VariableDescriptorWithAccessors
|
||||
descriptor: VariableDescriptorWithAccessors,
|
||||
type: IrType
|
||||
) : this(
|
||||
startOffset, endOffset, origin, descriptor,
|
||||
descriptor.name, descriptor.type, descriptor.isVar
|
||||
descriptor.name, type, descriptor.isVar
|
||||
)
|
||||
|
||||
constructor(
|
||||
@@ -52,8 +54,9 @@ class IrLocalDelegatedPropertyImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: VariableDescriptorWithAccessors,
|
||||
type: IrType,
|
||||
delegate: IrVariable
|
||||
) : this(startOffset, endOffset, origin, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, descriptor, type) {
|
||||
this.delegate = delegate
|
||||
}
|
||||
|
||||
@@ -62,10 +65,11 @@ class IrLocalDelegatedPropertyImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: VariableDescriptorWithAccessors,
|
||||
type: IrType,
|
||||
delegate: IrVariable,
|
||||
getter: IrFunction,
|
||||
setter: IrFunction?
|
||||
) : this(startOffset, endOffset, origin, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, descriptor, type) {
|
||||
this.delegate = delegate
|
||||
this.getter = getter
|
||||
this.setter = setter
|
||||
|
||||
+12
-8
@@ -20,12 +20,12 @@ import org.jetbrains.kotlin.descriptors.Modality
|
||||
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.Visibility
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.util.transform
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isEffectivelyExternal
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
|
||||
class IrPropertyImpl(
|
||||
@@ -34,7 +34,7 @@ class IrPropertyImpl(
|
||||
origin: IrDeclarationOrigin,
|
||||
override val descriptor: PropertyDescriptor,
|
||||
override val name: Name,
|
||||
override val type: KotlinType,
|
||||
override val type: IrType,
|
||||
override val visibility: Visibility,
|
||||
override val modality: Modality,
|
||||
override val isVar: Boolean,
|
||||
@@ -50,10 +50,11 @@ class IrPropertyImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
isDelegated: Boolean,
|
||||
descriptor: PropertyDescriptor
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType
|
||||
) : this(
|
||||
startOffset, endOffset, origin, descriptor,
|
||||
descriptor.name, descriptor.type, descriptor.visibility, descriptor.modality,
|
||||
descriptor.name, type, descriptor.visibility, descriptor.modality,
|
||||
isVar = descriptor.isVar,
|
||||
isConst = descriptor.isConst,
|
||||
isLateinit = descriptor.isLateInit,
|
||||
@@ -65,8 +66,9 @@ class IrPropertyImpl(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: PropertyDescriptor
|
||||
) : this(startOffset, endOffset, origin, descriptor.isDelegated, descriptor)
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType
|
||||
) : this(startOffset, endOffset, origin, descriptor.isDelegated, descriptor, type)
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
@@ -74,8 +76,9 @@ class IrPropertyImpl(
|
||||
origin: IrDeclarationOrigin,
|
||||
isDelegated: Boolean,
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType,
|
||||
backingField: IrField?
|
||||
) : this(startOffset, endOffset, origin, isDelegated, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, isDelegated, descriptor, type) {
|
||||
this.backingField = backingField
|
||||
}
|
||||
|
||||
@@ -85,10 +88,11 @@ class IrPropertyImpl(
|
||||
origin: IrDeclarationOrigin,
|
||||
isDelegated: Boolean,
|
||||
descriptor: PropertyDescriptor,
|
||||
type: IrType,
|
||||
backingField: IrField?,
|
||||
getter: IrSimpleFunction?,
|
||||
setter: IrSimpleFunction?
|
||||
) : this(startOffset, endOffset, origin, isDelegated, descriptor, backingField) {
|
||||
) : this(startOffset, endOffset, origin, isDelegated, descriptor, type, backingField) {
|
||||
this.getter = getter
|
||||
this.setter = setter
|
||||
}
|
||||
|
||||
+4
-1
@@ -27,7 +27,10 @@ class IrTypeAliasImpl(
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
override val descriptor: TypeAliasDescriptor
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin), IrTypeAlias {
|
||||
) :
|
||||
IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrTypeAlias {
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R {
|
||||
return visitor.visitTypeAlias(this, data)
|
||||
}
|
||||
|
||||
+22
-8
@@ -22,10 +22,10 @@ import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.types.Variance
|
||||
import org.jetbrains.kotlin.utils.SmartList
|
||||
|
||||
@@ -37,20 +37,34 @@ class IrTypeParameterImpl(
|
||||
override val name: Name,
|
||||
override val index: Int,
|
||||
override val variance: Variance,
|
||||
override val upperBounds: List<KotlinType>
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin), IrTypeParameter {
|
||||
override val upperBounds: List<IrType>
|
||||
) :
|
||||
IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrTypeParameter {
|
||||
|
||||
constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, symbol: IrTypeParameterSymbol) :
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrTypeParameterSymbol,
|
||||
upperBounds: List<IrType>
|
||||
) :
|
||||
this(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
symbol.descriptor.name,
|
||||
symbol.descriptor.index,
|
||||
symbol.descriptor.variance,
|
||||
symbol.descriptor.upperBounds.toMutableList()
|
||||
upperBounds
|
||||
)
|
||||
|
||||
constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: TypeParameterDescriptor) :
|
||||
this(startOffset, endOffset, origin, IrTypeParameterSymbolImpl(descriptor))
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: TypeParameterDescriptor,
|
||||
upperBounds: List<IrType>
|
||||
) :
|
||||
this(startOffset, endOffset, origin, IrTypeParameterSymbolImpl(descriptor), upperBounds)
|
||||
|
||||
init {
|
||||
symbol.bind(this)
|
||||
@@ -58,7 +72,7 @@ class IrTypeParameterImpl(
|
||||
|
||||
override val descriptor: TypeParameterDescriptor get() = symbol.descriptor
|
||||
|
||||
override val superClassifiers: MutableList<IrClassifierSymbol> = SmartList<IrClassifierSymbol>()
|
||||
override val superClassifiers: MutableList<IrClassifierSymbol> = SmartList()
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
visitor.visitTypeParameter(this, data)
|
||||
|
||||
+29
-11
@@ -23,10 +23,10 @@ import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpressionBody
|
||||
import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
class IrValueParameterImpl(
|
||||
@@ -36,34 +36,52 @@ class IrValueParameterImpl(
|
||||
override val symbol: IrValueParameterSymbol,
|
||||
override val name: Name,
|
||||
override val index: Int,
|
||||
override val type: KotlinType,
|
||||
override val varargElementType: KotlinType?,
|
||||
override val type: IrType,
|
||||
override val varargElementType: IrType?,
|
||||
override val isCrossinline: Boolean,
|
||||
override val isNoinline: Boolean
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin), IrValueParameter {
|
||||
) :
|
||||
IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrValueParameter {
|
||||
|
||||
constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, symbol: IrValueParameterSymbol) :
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrValueParameterSymbol,
|
||||
type: IrType,
|
||||
varargElementType: IrType?
|
||||
) :
|
||||
this(
|
||||
startOffset, endOffset, origin,
|
||||
symbol,
|
||||
symbol.descriptor.name,
|
||||
symbol.descriptor.safeAs<ValueParameterDescriptor>()?.index ?: -1,
|
||||
symbol.descriptor.type,
|
||||
symbol.descriptor.safeAs<ValueParameterDescriptor>()?.varargElementType,
|
||||
type,
|
||||
varargElementType,
|
||||
symbol.descriptor.safeAs<ValueParameterDescriptor>()?.isCrossinline ?: false,
|
||||
symbol.descriptor.safeAs<ValueParameterDescriptor>()?.isNoinline ?: false
|
||||
)
|
||||
|
||||
constructor(startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin, descriptor: ParameterDescriptor) :
|
||||
this(startOffset, endOffset, origin, IrValueParameterSymbolImpl(descriptor))
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: ParameterDescriptor,
|
||||
type: IrType,
|
||||
varargElementType: IrType?
|
||||
) :
|
||||
this(startOffset, endOffset, origin, IrValueParameterSymbolImpl(descriptor), type, varargElementType)
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: ParameterDescriptor,
|
||||
type: IrType,
|
||||
varargElementType: IrType?,
|
||||
defaultValue: IrExpressionBody?
|
||||
) : this(startOffset, endOffset, origin, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, descriptor, type, varargElementType) {
|
||||
this.defaultValue = defaultValue
|
||||
}
|
||||
|
||||
|
||||
+12
-8
@@ -22,10 +22,10 @@ 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.types.IrType
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
|
||||
class IrVariableImpl(
|
||||
startOffset: Int,
|
||||
@@ -33,21 +33,23 @@ class IrVariableImpl(
|
||||
origin: IrDeclarationOrigin,
|
||||
override val symbol: IrVariableSymbol,
|
||||
override val name: Name,
|
||||
override val type: KotlinType,
|
||||
override val type: IrType,
|
||||
override val isVar: Boolean,
|
||||
override val isConst: Boolean,
|
||||
override val isLateinit: Boolean
|
||||
) : IrDeclarationBase(startOffset, endOffset, origin),
|
||||
) :
|
||||
IrDeclarationBase(startOffset, endOffset, origin),
|
||||
IrVariable {
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
symbol: IrVariableSymbol
|
||||
symbol: IrVariableSymbol,
|
||||
type: IrType
|
||||
) : this(
|
||||
startOffset, endOffset, origin, symbol,
|
||||
symbol.descriptor.name, symbol.descriptor.type,
|
||||
symbol.descriptor.name, type,
|
||||
isVar = symbol.descriptor.isVar,
|
||||
isConst = symbol.descriptor.isConst,
|
||||
isLateinit = symbol.descriptor.isLateInit
|
||||
@@ -57,16 +59,18 @@ class IrVariableImpl(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: VariableDescriptor
|
||||
) : this(startOffset, endOffset, origin, IrVariableSymbolImpl(descriptor))
|
||||
descriptor: VariableDescriptor,
|
||||
type: IrType
|
||||
) : this(startOffset, endOffset, origin, IrVariableSymbolImpl(descriptor), type)
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: VariableDescriptor,
|
||||
type: IrType,
|
||||
initializer: IrExpression?
|
||||
) : this(startOffset, endOffset, origin, descriptor) {
|
||||
) : this(startOffset, endOffset, origin, descriptor, type) {
|
||||
this.initializer = initializer
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user