IR: remove a KotlinType use from Ir.kt
This commit is contained in:
@@ -118,22 +118,30 @@ open class BuiltinSymbolsBase(protected val irBuiltIns: IrBuiltIns, protected va
|
||||
.getContributedFunctions(Name.identifier("getProgressionLastElement"), NoLookupLocation.FROM_BACKEND)
|
||||
.filter { it.containingDeclaration !is BuiltInsPackageFragment }
|
||||
.map { d ->
|
||||
val c = d.returnType?.constructor?.declarationDescriptor?.let { symbolTable.referenceClassifier(it) }
|
||||
val f = symbolTable.referenceSimpleFunction(d)
|
||||
c to f
|
||||
val klass = d.returnType?.constructor?.declarationDescriptor?.let { symbolTable.referenceClassifier(it) }
|
||||
val function = symbolTable.referenceSimpleFunction(d)
|
||||
klass to function
|
||||
}.toMap()
|
||||
|
||||
val toUIntByExtensionReceiver = builtInsPackage("kotlin").getContributedFunctions(
|
||||
Name.identifier("toUInt"),
|
||||
NoLookupLocation.FROM_BACKEND
|
||||
).filter { it.containingDeclaration !is BuiltInsPackageFragment && it.extensionReceiverParameter != null }
|
||||
.map { Pair(it.extensionReceiverParameter!!.type, symbolTable.referenceSimpleFunction(it)) }.toMap()
|
||||
.map {
|
||||
val klass = symbolTable.referenceClassifier(it.extensionReceiverParameter!!.type.constructor.declarationDescriptor!!)
|
||||
val function = symbolTable.referenceSimpleFunction(it)
|
||||
klass to function
|
||||
}.toMap()
|
||||
|
||||
val toULongByExtensionReceiver = builtInsPackage("kotlin").getContributedFunctions(
|
||||
Name.identifier("toULong"),
|
||||
NoLookupLocation.FROM_BACKEND
|
||||
).filter { it.containingDeclaration !is BuiltInsPackageFragment && it.extensionReceiverParameter != null }
|
||||
.map { Pair(it.extensionReceiverParameter!!.type, symbolTable.referenceSimpleFunction(it)) }.toMap()
|
||||
.map {
|
||||
val klass = symbolTable.referenceClassifier(it.extensionReceiverParameter!!.type.constructor.declarationDescriptor!!)
|
||||
val function = symbolTable.referenceSimpleFunction(it)
|
||||
klass to function
|
||||
}.toMap()
|
||||
|
||||
val any = symbolTable.referenceClass(builtIns.any)
|
||||
val unit = symbolTable.referenceClass(builtIns.unit)
|
||||
|
||||
+2
-2
@@ -201,7 +201,7 @@ internal class UIntProgressionType(symbols: Symbols<CommonBackendContext>) :
|
||||
// Uses `getProgressionLastElement(UInt, UInt, Int): UInt`
|
||||
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uInt!!],
|
||||
unsignedType = symbols.uInt!!.defaultType,
|
||||
unsignedConversionFunction = symbols.toUIntByExtensionReceiver.getValue(symbols.int.defaultType.toKotlinType())
|
||||
unsignedConversionFunction = symbols.toUIntByExtensionReceiver.getValue(symbols.int)
|
||||
) {
|
||||
override fun DeclarationIrBuilder.minValueExpression() = irInt(UInt.MIN_VALUE.toInt())
|
||||
|
||||
@@ -219,7 +219,7 @@ internal class ULongProgressionType(symbols: Symbols<CommonBackendContext>) :
|
||||
// Uses `getProgressionLastElement(ULong, ULong, Long): ULong`
|
||||
getProgressionLastElementFunction = symbols.getProgressionLastElementByReturnType[symbols.uLong!!],
|
||||
unsignedType = symbols.uLong!!.defaultType,
|
||||
unsignedConversionFunction = symbols.toULongByExtensionReceiver.getValue(symbols.long.defaultType.toKotlinType())
|
||||
unsignedConversionFunction = symbols.toULongByExtensionReceiver.getValue(symbols.long)
|
||||
) {
|
||||
override fun DeclarationIrBuilder.minValueExpression() = irLong(ULong.MIN_VALUE.toLong())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user