IR: remove deprecated constructor of IrTypeParameterImpl
This commit is contained in:
-14
@@ -22,7 +22,6 @@ import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
|||||||
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
import org.jetbrains.kotlin.ir.declarations.IrTypeParameter
|
||||||
import org.jetbrains.kotlin.ir.declarations.impl.carriers.TypeParameterCarrier
|
import org.jetbrains.kotlin.ir.declarations.impl.carriers.TypeParameterCarrier
|
||||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
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.types.IrType
|
||||||
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
import org.jetbrains.kotlin.ir.visitors.IrElementTransformer
|
||||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||||
@@ -44,19 +43,6 @@ class IrTypeParameterImpl(
|
|||||||
IrTypeParameter,
|
IrTypeParameter,
|
||||||
TypeParameterCarrier {
|
TypeParameterCarrier {
|
||||||
|
|
||||||
@Deprecated("Use constructor which takes symbol instead of descriptor")
|
|
||||||
constructor(
|
|
||||||
startOffset: Int,
|
|
||||||
endOffset: Int,
|
|
||||||
origin: IrDeclarationOrigin,
|
|
||||||
descriptor: TypeParameterDescriptor,
|
|
||||||
name: Name = descriptor.name,
|
|
||||||
symbol: IrTypeParameterSymbol = IrTypeParameterSymbolImpl(descriptor)
|
|
||||||
) : this(
|
|
||||||
startOffset, endOffset, origin, symbol, name,
|
|
||||||
index = descriptor.index, isReified = descriptor.isReified, variance = descriptor.variance
|
|
||||||
)
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
symbol.bind(this)
|
symbol.bind(this)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -826,13 +826,17 @@ open class SymbolTable(
|
|||||||
return IrTypeParameterSymbolImpl(descriptor)
|
return IrTypeParameterSymbolImpl(descriptor)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||||
fun declareGlobalTypeParameter(
|
fun declareGlobalTypeParameter(
|
||||||
startOffset: Int,
|
startOffset: Int,
|
||||||
endOffset: Int,
|
endOffset: Int,
|
||||||
origin: IrDeclarationOrigin,
|
origin: IrDeclarationOrigin,
|
||||||
descriptor: TypeParameterDescriptor,
|
descriptor: TypeParameterDescriptor,
|
||||||
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter = {
|
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter = {
|
||||||
IrTypeParameterImpl(startOffset, endOffset, origin, descriptor, nameProvider.nameForDeclaration(descriptor), it)
|
IrTypeParameterImpl(
|
||||||
|
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(descriptor),
|
||||||
|
it.descriptor.index, it.descriptor.isReified, it.descriptor.variance
|
||||||
|
)
|
||||||
}
|
}
|
||||||
): IrTypeParameter =
|
): IrTypeParameter =
|
||||||
globalTypeParameterSymbolTable.declare(
|
globalTypeParameterSymbolTable.declare(
|
||||||
@@ -850,13 +854,17 @@ open class SymbolTable(
|
|||||||
return globalTypeParameterSymbolTable.declare(descriptor, { IrTypeParameterSymbolImpl(descriptor) }, typeParameterFactory)
|
return globalTypeParameterSymbolTable.declare(descriptor, { IrTypeParameterSymbolImpl(descriptor) }, typeParameterFactory)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||||
fun declareScopedTypeParameter(
|
fun declareScopedTypeParameter(
|
||||||
startOffset: Int,
|
startOffset: Int,
|
||||||
endOffset: Int,
|
endOffset: Int,
|
||||||
origin: IrDeclarationOrigin,
|
origin: IrDeclarationOrigin,
|
||||||
descriptor: TypeParameterDescriptor,
|
descriptor: TypeParameterDescriptor,
|
||||||
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter = {
|
typeParameterFactory: (IrTypeParameterSymbol) -> IrTypeParameter = {
|
||||||
IrTypeParameterImpl(startOffset, endOffset, origin, descriptor, nameProvider.nameForDeclaration(descriptor), it)
|
IrTypeParameterImpl(
|
||||||
|
startOffset, endOffset, origin, it, nameProvider.nameForDeclaration(descriptor),
|
||||||
|
it.descriptor.index, it.descriptor.isReified, it.descriptor.variance
|
||||||
|
)
|
||||||
}
|
}
|
||||||
): IrTypeParameter =
|
): IrTypeParameter =
|
||||||
scopedTypeParameterSymbolTable.declare(
|
scopedTypeParameterSymbolTable.declare(
|
||||||
|
|||||||
+3
-1
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.ir.declarations.impl.*
|
|||||||
import org.jetbrains.kotlin.ir.expressions.*
|
import org.jetbrains.kotlin.ir.expressions.*
|
||||||
import org.jetbrains.kotlin.ir.expressions.impl.*
|
import org.jetbrains.kotlin.ir.expressions.impl.*
|
||||||
import org.jetbrains.kotlin.ir.symbols.*
|
import org.jetbrains.kotlin.ir.symbols.*
|
||||||
|
import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl
|
||||||
import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl
|
import org.jetbrains.kotlin.ir.symbols.impl.IrValueParameterSymbolImpl
|
||||||
import org.jetbrains.kotlin.ir.types.*
|
import org.jetbrains.kotlin.ir.types.*
|
||||||
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
|
import org.jetbrains.kotlin.ir.types.impl.IrSimpleTypeImpl
|
||||||
@@ -407,7 +408,8 @@ interface IrBuilderExtension {
|
|||||||
IrTypeParameterImpl(
|
IrTypeParameterImpl(
|
||||||
startOffset, endOffset,
|
startOffset, endOffset,
|
||||||
SERIALIZABLE_PLUGIN_ORIGIN,
|
SERIALIZABLE_PLUGIN_ORIGIN,
|
||||||
it
|
IrTypeParameterSymbolImpl(it),
|
||||||
|
it.name, it.index, it.isReified, it.variance
|
||||||
).also { typeParameter ->
|
).also { typeParameter ->
|
||||||
typeParameter.parent = this
|
typeParameter.parent = this
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user