Skip to content

Compiler "assertion failed" when using unknown type #1711

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vincent-tr opened this issue Mar 4, 2021 · 1 comment · Fixed by #1760
Closed

Compiler "assertion failed" when using unknown type #1711

vincent-tr opened this issue Mar 4, 2021 · 1 comment · Fixed by #1760
Labels

Comments

@vincent-tr
Copy link

Expected behavior

Get a clear error that the type is unknown. Possibly other related errors when using the type.

Steps to reproduce

Compile the following code:

class MyClass {
  get value(): UnknownType {
  }
}

export function test(obj: MyClass): void {
  obj.value;
}

On the playground https://www.assemblyscript.org/editor.html I get the "assertion failed" in the browser's console:

AssertionError: assertion failed
    at i.assert (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:722100)
    at f.compilePropertyAccessExpression (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:317653)
    at f.compileExpression (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:236891)
    at f.compileExpressionStatement (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:225012)
    at f.compileStatement (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:221342)
    at f.compileStatements (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:222370)
    at f.compileFunctionBody (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:211588)
    at f.compileFunction (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:210572)
    at f.compileElement (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:202495)
    at f.compileExports (https://cdn.jsdelivr.net/npm/[email protected]/dist/assemblyscript.js:7:203235)
@dcodeIO
Copy link
Member

dcodeIO commented Mar 27, 2021

Thanks, should be fixed :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants