Skip to content
This repository

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

Closed
bstrie opened this Issue September 18, 2012 · 4 comments

2 participants

Ben Striegel Tim Chevalier
Ben Striegel
Collaborator

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);
}
Ben Striegel
Collaborator

Related to #2428.

Tim Chevalier
Collaborator

Related to #3668 too, I think (discrs are supposed to be constants, right?)

Tim Chevalier
Collaborator

Also, reproduced as of a477c5a

Tim Chevalier
Collaborator

This is basically the intersection of #2428 and #3668: discriminator exprs aren't getting resolved at all (#2428) and if they were, they would also have to be treated as constants correctly so that this would be a resolve error (#3668).

Tim Chevalier catamorphism closed this in 4f9e7ba October 15, 2012
Jay Anderson jayanderson referenced this issue from a commit November 10, 2013
Commit has since been removed from the repository and is no longer available.
Jay Anderson jayanderson referenced this issue from a commit November 10, 2013
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.