[JS IR] Fix js("...") call checker in frontend.
Call mather relies on that BuiltIn package fragment implement specific interface `BuiltInsPackageFragment` which was missed. Make sure that BuiltIn module's package fragments implement that interface. Fix progression optimizer symbols resolve in JS & WASM IR BE
This commit is contained in:
committed by
TeamCityServer
parent
18950feeff
commit
f05c8ad953
@@ -17,10 +17,12 @@ import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
|
||||
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.classifierOrFail
|
||||
import org.jetbrains.kotlin.ir.types.defaultType
|
||||
import org.jetbrains.kotlin.ir.types.typeWith
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.ir.util.render
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||
@@ -178,6 +180,31 @@ class WasmSymbols(
|
||||
val arraysCopyInto = findFunctions(collectionsPackage.memberScope, Name.identifier("copyInto"))
|
||||
.map { symbolTable.referenceSimpleFunction(it) }
|
||||
|
||||
private val getProgressionLastElementSymbols =
|
||||
irBuiltIns.findFunctions(Name.identifier("getProgressionLastElement"), "kotlin", "internal")
|
||||
|
||||
override val getProgressionLastElementByReturnType: Map<IrClassifierSymbol, IrSimpleFunctionSymbol> by lazy {
|
||||
getProgressionLastElementSymbols.associateBy { it.owner.returnType.classifierOrFail }
|
||||
}
|
||||
|
||||
private val toUIntSymbols = irBuiltIns.findFunctions(Name.identifier("toUInt"), "kotlin")
|
||||
|
||||
override val toUIntByExtensionReceiver: Map<IrClassifierSymbol, IrSimpleFunctionSymbol> by lazy {
|
||||
toUIntSymbols.associateBy {
|
||||
it.owner.extensionReceiverParameter?.type?.classifierOrFail
|
||||
?: error("Expected extension receiver for ${it.owner.render()}")
|
||||
}
|
||||
}
|
||||
|
||||
private val toULongSymbols = irBuiltIns.findFunctions(Name.identifier("toULong"), "kotlin")
|
||||
|
||||
override val toULongByExtensionReceiver: Map<IrClassifierSymbol, IrSimpleFunctionSymbol> by lazy {
|
||||
toULongSymbols.associateBy {
|
||||
it.owner.extensionReceiverParameter?.type?.classifierOrFail
|
||||
?: error("Expected extension receiver for ${it.owner.render()}")
|
||||
}
|
||||
}
|
||||
|
||||
override fun functionN(n: Int): IrClassSymbol =
|
||||
functionNInterfaces[n]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user