Skip to content

Compiler crash: unknown class property works until actually used #2565

Closed
@mariusa

Description

@mariusa
class Hello {
    prop: string
    // world: Inexistent
    world: World
}


// @JSON
// class World {
//     prop2: string
//     prop3: i32
//     cart: Bump
// }

const testFunc = (hello: Hello): string => {
    return 'aa'
}
console.log('hello')

gives

$ npx asc assembly/test.ts --target release
Whoops, the AssemblyScript compiler has crashed during compile :-(
▌ 
▌ Here is the stack trace hinting at the problem, perhaps it's useful?
▌ 
▌ /my-proj/node_modules/assemblyscript/std/portable/index.js:198
▌     throw new AssertionError(message);
▌           ^
▌ 
▌ AssertionError: assertion failed

Issue 1: crash
Issue 2: removing testFunc then compiling gives no error. Should error with 'Unknown type World`

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