You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler crashes whenever a ref_extern is used as a member variable of a class. Also happens for similar reference types (e.g. ref_func) or nullable reference types (e.g. externref).
Steps to reproduce
Use the following code:
class MyWrapper {
ref: externref;
}
let mywrapper = new MyWrapper();
This causes a compiler assertion:
Whoops, the AssemblyScript compiler has crashed during compile :-(
▌
▌ Here is the stack trace hinting at the problem, perhaps it's useful?
▌
▌ AssertionError: assertion failed
▌ at Y.assert (.\wasm\node_modules\assemblyscript\std\portable\index.js:216:11)
▌ at Kn.finishResolveClass (.\wasm\node_modules\assemblyscript\src\resolver.ts:3433:19)
▌ at Kn.resolveClass (.\wasm\node_modules\assemblyscript\src\resolver.ts:3222:10)
▌ at Kn.resolveClassInclTypeArguments (.\wasm\node_modules\assemblyscript\src\resolver.ts:3652:17)
▌ at jr.compileNewExpression (.\wasm\node_modules\assemblyscript\src\compiler.ts:8710:37)
▌ at jr.compileExpression (.\wasm\node_modules\assemblyscript\src\compiler.ts:3397:21)
▌ at jr.compileGlobal (.\wasm\node_modules\assemblyscript\src\compiler.ts:1183:25)
▌ at jr.compileTopLevelStatement (.\wasm\node_modules\assemblyscript\src\compiler.ts:2125:20)
▌ at jr.compileFile (.\wasm\node_modules\assemblyscript\src\compiler.ts:1099:12)
▌ at jr.compile (.\wasm\node_modules\assemblyscript\src\compiler.ts:548:14)
▌
▌ If you see where the error is, feel free to send us a pull request. If not,
▌ please let us know: https://github.com/AssemblyScript/assemblyscript/issues
▌
▌ Thank you!
AssemblyScript version
0.27.6
The text was updated successfully, but these errors were encountered:
Since reference types can't be written to linear memory, they don't have
proper byte sizes, which triggers an assert. Instead, the compiler
should signal its lack of support for this feature.
FixesAssemblyScript#2726.
Bug description
The compiler crashes whenever a
ref_extern
is used as a member variable of a class. Also happens for similar reference types (e.g.ref_func
) or nullable reference types (e.g.externref
).Steps to reproduce
Use the following code:
This causes a compiler assertion:
AssemblyScript version
0.27.6
The text was updated successfully, but these errors were encountered: