8000 Specifically sized enums. · Issue #715 · ark-lang/ark · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Jun 13, 2020. It is now read-only.
This repository was archived by the owner on Jun 13, 2020. It is now read-only.
Specifically sized enums. #715
Open
Open
@kiljacken

Description

@kiljacken

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0