"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

Comments

Projects
None yet
2 participants
@bstrie
Contributor

bstrie commented Sep 18, 2012

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

This comment has been minimized.

Show comment
Hide comment
@bstrie

bstrie Sep 18, 2012

Contributor

Related to #2428.

Contributor

bstrie commented Sep 18, 2012

Related to #2428.

@ghost ghost assigned catamorphism Sep 20, 2012

@catamorphism

This comment has been minimized.

Show comment
Hide comment
@catamorphism

catamorphism Oct 8, 2012

Contributor

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

Contributor

catamorphism commented Oct 8, 2012

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

@catamorphism

This comment has been minimized.

Show comment
Hide comment
@catamorphism

catamorphism Oct 8, 2012

Contributor

Also, reproduced as of a477c5a

Contributor

catamorphism commented Oct 8, 2012

Also, reproduced as of a477c5a

@catamorphism

This comment has been minimized.

Show comment
Hide comment
@catamorphism

catamorphism Oct 8, 2012

Contributor

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

Contributor

catamorphism commented Oct 8, 2012

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 added a commit that referenced this issue Oct 15, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment