IR: remove deprecated constructors of IrVariableImpl
This commit is contained in:
@@ -81,13 +81,10 @@ class Scope(val scopeOwnerSymbol: IrSymbol) {
|
||||
endOffset: Int = UNDEFINED_OFFSET
|
||||
): IrVariable {
|
||||
val originalKotlinType = type ?: irType.toKotlinType()
|
||||
val descriptor = createDescriptorForTemporaryVariable(originalKotlinType, nameHint, isMutable)
|
||||
return IrVariableImpl(
|
||||
startOffset, endOffset, origin,
|
||||
createDescriptorForTemporaryVariable(
|
||||
originalKotlinType,
|
||||
nameHint, isMutable
|
||||
),
|
||||
irType
|
||||
startOffset, endOffset, origin, IrVariableSymbolImpl(descriptor), descriptor.name,
|
||||
irType, isMutable, isConst = false, isLateinit = false
|
||||
).apply {
|
||||
parent = getLocalDeclarationParent()
|
||||
}
|
||||
|
||||
+1
-29
@@ -25,7 +25,6 @@ import org.jetbrains.kotlin.ir.declarations.MetadataSource
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
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
|
||||
@@ -54,33 +53,6 @@ class IrVariableImpl(
|
||||
override var annotations: List<IrConstructorCall> = emptyList()
|
||||
override val metadata: MetadataSource? get() = null
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: VariableDescriptor,
|
||||
type: IrType,
|
||||
name: Name = descriptor.name,
|
||||
symbol: IrVariableSymbol = IrVariableSymbolImpl(descriptor)
|
||||
) : this(
|
||||
startOffset, endOffset, origin,
|
||||
symbol, name, type,
|
||||
isVar = descriptor.isVar,
|
||||
isConst = descriptor.isConst,
|
||||
isLateinit = descriptor.isLateInit
|
||||
)
|
||||
|
||||
constructor(
|
||||
startOffset: Int,
|
||||
endOffset: Int,
|
||||
origin: IrDeclarationOrigin,
|
||||
descriptor: VariableDescriptor,
|
||||
type: IrType,
|
||||
initializer: IrExpression?
|
||||
) : this(startOffset, endOffset, origin, descriptor, type) {
|
||||
this.initializer = initializer
|
||||
}
|
||||
|
||||
init {
|
||||
symbol.bind(this)
|
||||
}
|
||||
@@ -100,4 +72,4 @@ class IrVariableImpl(
|
||||
override fun <D> transformChildren(transformer: IrElementTransformer<D>, data: D) {
|
||||
initializer = initializer?.transform(transformer, data)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -927,9 +927,11 @@ open class SymbolTable(
|
||||
descriptor: VariableDescriptor,
|
||||
type: IrType,
|
||||
variableFactory: (IrVariableSymbol) -> IrVariable = {
|
||||
IrVariableImpl(startOffset, endOffset, origin, descriptor, type, nameProvider.nameForDeclaration(descriptor), it)
|
||||
IrVariableImpl(
|
||||
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(descriptor), type,
|
||||
descriptor.isVar, descriptor.isConst, descriptor.isLateInit
|
||||
)
|
||||
}
|
||||
|
||||
): IrVariable =
|
||||
variableSymbolTable.declareLocal(
|
||||
descriptor,
|
||||
|
||||
Reference in New Issue
Block a user