Skip to content

SSA builder panic on nested enum match #230

Description

@micahscopes

Nested match on enum values panics in the SSA builder. This blocks writing manual impl Eq for enums.

use core::ops::Eq

pub enum Color { Red, Green, Blue }

impl Eq for Color {
    fn eq(self, _ other: Color) -> bool {
        match self {
            Color::Red => match other {
                Color::Red => true,
                _ => false,
            },
            Color::Green => match other {
                Color::Green => true,
                _ => false,
            },
            Color::Blue => match other {
                Color::Blue => true,
                _ => false,
            },
        }
    }
}
panicked at crates/ir/src/builder/ssa.rs:139
variable is undefined or used in unreachable block

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