Skip to content

Print better errors for unusual using void, null and undefined types #558

@MaxGraey

Description

@MaxGraey
  1. Currently this cause to "assertion failed" inside compiler:
export function test(x: void): void {}
  1. For:
export function test(x: undefined): void {}

Output: "ERROR TS2304: Cannot find name 'undefined'."

  1. For:
export function test(x: null): void {}

Output: "ERROR TS1003: Identifier expected."

  1. For:
export function test(a: string | undefined): void {}

Output: "ERROR TS1005: 'null' expected." but also "ERROR TS1109: Expression expected." twice after that.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions