diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt index 7b2714265e7..25dc9d83bab 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/ir/Ir.kt @@ -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) diff --git a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionType.kt b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionType.kt index f06867fb295..8e933751237 100644 --- a/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionType.kt +++ b/compiler/ir/backend.common/src/org/jetbrains/kotlin/backend/common/lower/loops/ProgressionType.kt @@ -201,7 +201,7 @@ internal class UIntProgressionType(symbols: Symbols) : // 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) : // 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())