Skip to content

Encounter an compiler error after translate a TS lib to assemblyscript #2611

New issue

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

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

Already on GitHub? Sign in to your account

Closed
DeanHH opened this issue Jan 9, 2023 · 1 comment · Fixed by #2631
Closed

Encounter an compiler error after translate a TS lib to assemblyscript #2611

DeanHH opened this issue Jan 9, 2023 · 1 comment · Fixed by #2631
Labels

Comments

@DeanHH
Copy link

DeanHH commented Jan 9, 2023

Here is the error info:
/Users/dean/assemblyscript/std/portable/index.js:198
throw new AssertionError(message);
^

AssertionError: assertion failed
at null.Y.assert (/Users/dean/assemblyscript/std/portable/index.js:198:11)
at sr.visitElement (/Users/dean/assemblyscript/src/bindings/util.ts:116:16)
at sr.visitFile (/Users/dean/assemblyscript/src/bindings/util.ts:58:14)
at sr.visitFile (/Users/dean/assemblyscript/src/bindings/util.ts:65:14)
at sr.walk (/Users/dean/assemblyscript/src/bindings/util.ts:46:64)
at sr.build (/Users/dean/assemblyscript/src/bindings/tsd.ts:201:10)
at Function.build (/Users/dean/assemblyscript/src/bindings/tsd.ts:41:41)
at Module.XS (/Users/dean/assemblyscript/src/index-wasm.ts:363:21)
at Module.Mn (/Users/dean/assemblyscript/cli/index.js:974:35)
at async file:///Users/dean/assemblyscript/bin/asc.js:33:22

I'am trying to Translate https://github.com/EsotericSoftware/spine-runtimes/tree/4.1/spine-ts/spine-core to assemblyscript. Some moduler like Texutre and AssetManager has been removed and hunders of error has been fixed, but still get lots of warnings and all of them are like:"WARNING AS235: Only variables, functions and enums become WebAssembly module exports.".

@dcodeIO
Copy link
Member

dcodeIO commented Jan 12, 2023

Regarding "WARNING AS235: Only variables, functions and enums become WebAssembly module exports", this warning is emitted when exporting an element that does not materialize a concrete export on the Wasm/JS boundary, yet. Removing the respective export gets rid of the warning. Only relevant in the main entry file(s).

The assertion being hit looks like a bug that might be related to exporting such elements, as it is hit in src/bindings/util.ts in ExportsWalker#visitElement, which walks these exports. Perhaps, when removing the export keywords, could you check which one also fixes the assertion?

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

Successfully merging a pull request may close this issue.

2 participants