Skip to content

Declaration that indexes itself crashes the compiler #2204

Closed
@romdotdog

Description

@romdotdog

Code

let a = a[0];

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?
▌ 
▌ RangeError: Maximum call stack size exceeded
▌     at Flow.lookup (D:\assemblyscript\src\flow.ts:566:9)
▌     at Resolver.lookupIdentifierExpression (D:\assemblyscript\src\resolver.ts:1139:27)
▌     at Resolver.resolveIdentifierExpression (D:\assemblyscript\src\resolver.ts:1202:24)
▌     at Resolver.resolveExpression (D:\assemblyscript\src\resolver.ts:1054:21)
▌     at Resolver.lookupElementAccessExpression (D:\assemblyscript\src\resolver.ts:1464:27)
▌     at Resolver.resolveElementAccessExpression (D:\assemblyscript\src\resolver.ts:1498:24)
▌     at Resolver.resolveExpression (D:\assemblyscript\src\resolver.ts:1039:21)
▌     at Resolver.ensureResolvedLazyGlobal (D:\assemblyscript\src\resolver.ts:1229:19)
▌     at Resolver.getTypeOfElement (D:\assemblyscript\src\resolver.ts:857:17)
▌     at Resolver.resolveIdentifierExpression (D:\assemblyscript\src\resolver.ts:1209:21)
▌     at Resolver.resolveExpression (D:\assemblyscript\src\resolver.ts:1054:21)
▌     at Resolver.lookupElementAccessExpression (D:\assemblyscript\src\resolver.ts:1464:27)
▌     at Resolver.resolveElementAccessExpression (D:\assemblyscript\src\resolver.ts:1498:24)
▌     at Resolver.resolveExpression (D:\assemblyscript\src\resolver.ts:1039:21)
▌     at Resolver.ensureResolvedLazyGlobal (D:\assemblyscript\src\resolver.ts:1229:19)
▌ 
▌ 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