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
Currently the parser crashes with the following stacktrace when declaring inline indexable types:
$ npx asc assembly/test.ts --target debug
node_modules/assemblyscript/std/portable/index.js:198
throw new AssertionError(message);
^
AssertionError: assertion failed
at null.Y.assert (node_modules/assemblyscript/std/portable/index.js:198:11)
at $n.parseExpression (node_modules/assemblyscript/src/parser.ts:4320:18)
at $n.parseExpressionStart (node_modules/assemblyscript/src/parser.ts:3863:25)
at $n.parseExpression (node_modules/assemblyscript/src/parser.ts:4113:21)
at $n.parseExpressionStatement (node_modules/assemblyscript/src/parser.ts:3095:21)
at $n.parseStatement (node_modules/assemblyscript/src/parser.ts:2977:26)
at $n.parseBlockStatement (node_modules/assemblyscript/src/parser.ts:3001:28)
at $n.parseFunctionExpressionCommon (node_modules/assemblyscript/src/parser.ts:1639:21)
at $n.parseFunctionExpression (node_modules/assemblyscript/src/parser.ts:1595:17)
at $n.parseExpressionStart (node_modules/assemblyscript/src/parser.ts:3806:31)
The assertion has been addressed in #2629. Complex types like these cannot currently be parsed, as there isn't really an implementation story for these yet. It would of course be preferable if the parser at least skipped them to then diagnose what exactly is not supported.
Currently the parser crashes with the following stacktrace when declaring inline indexable types:
Code that crashes the parser:
Code that doesn't crash the parser (throws an error):
Expected behaviour:
having an inline definition of the type should raise the same error as if it was declared separately
The text was updated successfully, but these errors were encountered: