Skip to content
This repository has been archived by the owner on Jun 13, 2020. It is now read-only.

Specifically sized enums. #715

Open
kiljacken opened this issue Mar 1, 2016 · 0 comments
Open

Specifically sized enums. #715

kiljacken opened this issue Mar 1, 2016 · 0 comments
Labels
Milestone

Comments

@kiljacken
Copy link
Member

It occured to me that it would be useful to be able to specify hte size of a enum. We'd of course need a new syntax for this. I propose the following:

type Thing enum : u8 {
    A = 50,
    B,
    C,
}

In the case of simple enums it would simply be the size of the type, in case of a union enum it would be the size of the tag.

To go with this we'd probably need a semantic check for overflow of enum members.

@kiljacken kiljacken added the M-RFC label Mar 1, 2016
@kiljacken kiljacken added this to the bootstrap milestone Mar 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant