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

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

Projects

None yet

2 participants

@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);
}
@bstrie

Related to #2428.

@catamorphism catamorphism was assigned Sep 20, 2012
@catamorphism

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

@catamorphism

Also, reproduced as of a477c5a

@catamorphism

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).

@catamorphism catamorphism added a commit that referenced this issue Oct 15, 2012
@catamorphism catamorphism Allow enum discriminator exprs to refer to declared consts
Also some work towards #3521

Closes #2428
7237268
@catamorphism catamorphism added a commit that referenced this issue Oct 15, 2012
@catamorphism catamorphism Un-xfail test for #3521; it works now
Closes #3521
4f9e7ba
@jayanderson jayanderson pushed a commit that referenced this issue Nov 11, 2013
@catamorphism catamorphism Allow enum discriminator exprs to refer to declared consts
Also some work towards #3521

Closes #2428
b8f0079
@jayanderson jayanderson pushed a commit that referenced this issue Nov 11, 2013
@catamorphism catamorphism Un-xfail test for #3521; it works now
Closes #3521
23bec6c
@catamorphism catamorphism was unassigned by bstrie Jun 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment