Skip to content

Assertion error when assigning an enum instead of an enum member #1654

Closed
@saulecabrera

Description

@saulecabrera

Compiler Version: 0.18.3

The following example results in an assertion error instead of a diagnostic.

export enum A {
  Foo,
  Bar,
  Baz,
}

export const a: A = A;

I believe that the expected diagnostic here should be something like:

assembly/index.ts:13:14 - error TS2322: Type 'typeof A' is not assignable to type 'A'.

13 export const a: A = A;
                ~

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