Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in mapIt for enums #8566

Closed
coffeepots opened this issue Aug 8, 2018 · 1 comment
Closed

Regression in mapIt for enums #8566

coffeepots opened this issue Aug 8, 2018 · 1 comment
Assignees

Comments

@coffeepots
Copy link
Contributor

The commit ba5e2d6 causes a regression in the following code:

proc enumValues(E: typedesc[enum]): string =
  result = mapIt(E, $it).join(", ")
               # ^ Error here

Raising 'typedesc' metatype is not valid here; typed '=' instead of ':'?

More specifically, this manifests within the nim-chronicles library here: https://github.com/status-im/nim-chronicles/blob/master/chronicles/options.nim#L106

@LemonBoy LemonBoy self-assigned this Aug 8, 2018
LemonBoy added a commit to LemonBoy/Nim that referenced this issue Aug 8, 2018
Don't try to be too smart and limit the use of `evalOnce` where strictly
needed as not every value can be assigned with a `let`.

Fixes nim-lang#8566
@LemonBoy
Copy link
Contributor

LemonBoy commented Aug 8, 2018

Thanks for spotting this edge case, it should be fixed now :)

@Araq Araq closed this as completed in #8567 Aug 8, 2018
Araq pushed a commit that referenced this issue Aug 8, 2018
Don't try to be too smart and limit the use of `evalOnce` where strictly
needed as not every value can be assigned with a `let`.

Fixes #8566
timotheecour pushed a commit to timotheecour/Nim that referenced this issue Aug 8, 2018
Don't try to be too smart and limit the use of `evalOnce` where strictly
needed as not every value can be assigned with a `let`.

Fixes nim-lang#8566
timotheecour pushed a commit to timotheecour/Nim that referenced this issue Aug 8, 2018
Don't try to be too smart and limit the use of `evalOnce` where strictly
needed as not every value can be assigned with a `let`.

Fixes nim-lang#8566
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants