Skip to content

C-like enums discriminants values can be given different types #8761

Closed
@huonw

Description

@huonw

The following compiles fine, even though the discriminants are different types (I know that the annotations currently do nothing).

enum Foo { A = 1i64, B = 2u8 }

fn main() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions