Skip to content

Enum comparison (Eq) needed for state machines #1

@micahscopes

Description

@micahscopes

The escrow example uses an enum for contract state:

pub enum State { Empty, Funded, Released }

But == on enums doesn't work because Eq isn't implemented. The compiler should either auto-derive Eq for simple enums or provide a way to implement it manually without crashing (the match-based workaround panics sonatina).

Tracked upstream: needs Fe compiler support for enum equality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions