Skip to content

AS generates invalid .wast #120

@carllocos

Description

@carllocos

I wrote an AssemnlyScript application (see mirror-led.ts and config.ts in zip) that cannot be compiled to wasm. In particular, wat2wasm fails to compile the obtained wast file to wasm due to several type errors. Some of the errors that I get are:upload.wast:612:6: error: type mismatch in if true branch, expected [i32] but got [], and upload.wast:7658:4: error: type mismatch at end of function, expected [] but got [i32, i32]. All the files generated by asc can be found in the directory output of the zip.

This compilation issue comes as a surprise because the asc generates alongside the Wast file also a wasm file indicating that no type error occurred in the process. So this may mean that our wat2wasm is behind some language features.

This type error issue only manifest when compiling via asc without any optimisation. Since we also want to debug without optimisation I will have to further investigate this issue.

src_files.zip

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions