Skip to content

Cast a number to a c-style enum #2132

Closed
@jamorton

Description

@jamorton

It doesn't seem there is any way to do this:

enum foo { X, Y, Z }
let v : foo = 1 as foo;

( v == Y )

Useful for interfacing with c libraries, writing DCPU16 emulators (!!!), etc. Possible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemC-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions