Skip to content

Cast a number to a c-style enum #2132

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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