Closed
Description
Hi!
First thanks for all the work on AssemblyScript, it's getting really interesting! 👏 Looking forward to closures support, and really impressed to see a working GC :)
It seems that the compiler is crashing when an interface is declared inside a namespace. Hope it's not already reported somewhere, but I could not find anything similar.
Trying to compile this file:
export namespace test {
interface SomeInterface {
member: boolean;
};
}
Will result in this error:
Error [AssertionError]: assertion failed
at i.assert (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/dist/assemblyscript.js:7:701080)
at T.compileElement (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/dist/assemblyscript.js:7:201113)
at T.compileElement (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/dist/assemblyscript.js:7:201226)
at T.compileExports (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/dist/assemblyscript.js:7:201399)
at T.compile (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/dist/assemblyscript.js:7:192905)
at Object.t.compile (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/dist/assemblyscript.js:7:438198)
at /Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/cli/asc.js:715:29
at measure (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/cli/asc.js:1099:3)
at Object.main (/Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/cli/asc.js:714:24)
at /Users/florian/Projects/F/assembly-script-tests/node_modules/assemblyscript/bin/asc:21:47
/Users/florian/Projects/F/assembly-script-tests/node_modules/binaryen/index.js:54
function Ka(){var b=a.preRun.shift();Fa.unshift(b)}var L=0,La=null,Ma=null;a.preloadedImages={};a.preloadedAudios={};function q(b){if(a.onAbort)a.onAbort(b);v(b);wa=!0;throw new va("abort("+b+"). Build with -s ASSERTIONS=1 for more info.");}function Na(b){var d=Oa;return String.prototype.startsWith?b.startsWith(d):0===b.indexOf(d)}var Oa="data:application/octet-stream;base64,",Pa="<<< WASM_BINARY_FILE >>>";if(!Na(Pa)){var Qa=Pa;Pa=a.locateFile?a.locateFile(Qa,p):p+Qa}var Ra,Sa;
^
Error: abort(AssertionError: assertion failed). Build with -s ASSERTIONS=1 for more info.
at process.q (/Users/florian/Projects/F/assembly-script-tests/node_modules/binaryen/index.js:54:175)
at process.emit (events.js:315:20)
at processPromiseRejections (internal/process/promises.js:245:33)
at processTicksAndRejections (internal/process/task_queues.js:94:32)
I've checked the parser tests and it seems that interface should be supported, but maybe not in namespaces?
It seems this could generate other issues, because I have a larger file that continue to crash with interfaces even when taken outside of the namespace, but I figured I would first report this minimal case :)