assemblyscript
assemblyscript copied to clipboard
`TypeError: internref expected` when map is passed to a function
Bug description
Error TypeError: internref expected is raised by __lowerInternref when a Map is passed to a function
Steps to reproduce
create a .ts file with
export function mapError(map: Map<i32, String>): void {
console.log(`Has one? ${map.has(1)}`);
}
compile with
asc assembly/index.ts --target debug && asc assembly/index.ts --target release
in a js file
import { mapError } from "../build/debug.js";
mapError(new Map())
AssemblyScript version
0.27.13
Bindings for Map and Set doesn't support yet. Here a WIP pr which partially fix that https://github.com/AssemblyScript/assemblyscript/pull/2340. In the meantime, it's best to avoid these types for external exports