Skip to content

Declaration that gets the typeof itself crashes the compilerΒ #2205

Closed
@romdotdog

Description

@romdotdog

Credits

@DogWhich found this one, so credits to him πŸ˜„

Code

let a = typeof a;

Try it in the playground

Stack trace

β–Œ 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 assert (D:\assemblyscript\std\portable\index.js:200:11)
β–Œ     at Compiler.convertExpression (D:\assemblyscript\src\compiler.ts:3598:7)
β–Œ     at Compiler.compileTypeof (D:\assemblyscript\src\compiler.ts:9967:25)
β–Œ     at Compiler.compileUnaryPrefixExpression (D:\assemblyscript\src\compiler.ts:9889:21)
β–Œ     at Compiler.compileExpression (D:\assemblyscript\src\compiler.ts:3539:21)
β–Œ     at Compiler.compileGlobal (D:\assemblyscript\src\compiler.ts:1180:25)
β–Œ     at Compiler.compileTopLevelStatement (D:\assemblyscript\src\compiler.ts:2140:20)
β–Œ     at Compiler.compileFile (D:\assemblyscript\src\compiler.ts:1111:12)
β–Œ     at Compiler.compile (D:\assemblyscript\src\compiler.ts:486:14)
β–Œ     at Object.compile (D:\assemblyscript\src\index.ts:280:32)
β–Œ     at D:\assemblyscript\cli\asc.js:902:31
β–Œ     at measure (D:\assemblyscript\cli\asc.js:1409:3)
β–Œ     at Object.main (D:\assemblyscript\cli\asc.js:900:24)
β–Œ     at runTest (D:\assemblyscript\tests\compiler.js:178:7)
β–Œ     at Array.forEach (<anonymous>)
β–Œ 
β–Œ If it refers to the dist files, try to 'npm install source-map-support' and
β–Œ run again, which should then show the actual code location in the sources.
β–Œ 
β–Œ 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions