[Wasm] Fix external functions import clashing

This commit is contained in:
Igor Yakovlev
2022-12-19 22:49:44 +01:00
committed by teamcity
parent 35340f2f04
commit fc80104d55
5 changed files with 42 additions and 1 deletions
@@ -54,7 +54,10 @@ class DeclarationGenerator(
}
private fun jsCodeName(declaration: IrFunction): String {
return declaration.fqNameWhenAvailable!!.asString() + "_" + (declaration as IrSimpleFunction).wasmSignature(irBuiltIns).hashCode()
require(declaration is IrSimpleFunction)
val fqName = declaration.fqNameWhenAvailable!!.asString()
val hashCode = declaration.wasmSignature(irBuiltIns).hashCode() + declaration.file.path.hashCode()
return "${fqName}_$hashCode"
}
override fun visitFunction(declaration: IrFunction) {