Skip to content

"Internal error looking up a definition" when assigning an enum a value from a variable #3521

Closed
@bstrie

Description

@bstrie

This works:

fn main() {
    enum Stuff {
        Bar = 100
    }

    log(error, Bar);
}

But this doesn't:

fn main() {
    let foo = 100;

    enum Stuff {
        Bar = foo  // error: internal error looking up a definition
    }

    log(error, Bar);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-type-systemArea: Type systemI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions