Skip to content

TypeError: internref expected when map is passed to a function #2769

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
paciops opened this issue Oct 16, 2023 · 1 comment
Open

TypeError: internref expected when map is passed to a function #2769

paciops opened this issue Oct 16, 2023 · 1 comment
Labels

Comments

@paciops
Copy link

paciops commented Oct 16, 2023

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

@paciops paciops added the bug label Oct 16, 2023
@MaxGraey
Copy link
Member

Bindings for Map and Set doesn't support yet. Here a WIP pr which partially fix that #2340. In the meantime, it's best to avoid these types for external exports

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants