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

Codegen error when converting from set of range of integer to set of integer #16273

Closed
metagn opened this issue Dec 6, 2020 · 2 comments
Closed

Comments

@metagn
Copy link
Collaborator

metagn commented Dec 6, 2020

Example

var x: set[range[1u8..5u8]]
x.incl(1)
x.incl(3)
x.incl(5)
echo set[uint8](x)

Current Output

/usercode/nimcache/@min.nim.c:161:44: error: cast specifies array type
  T1_[0] = dollar___TUG7TzrD5Kd6aiBLNBckQA(((tySet_tyUInt8__k3HXouOuhqAKq0dx450lXQ) (x__EGWKGClUlppqAonIP2rgfg)));

Expected Output

{1, 3, 5}

Additional Information

$ nim -v
Nim Compiler Version 1.4.0
@metagn metagn changed the title Codegen error when upcasting from set of range of integer to set of integer Codegen error when converting from set of range of integer to set of integer Dec 6, 2020
@ringabout
Copy link
Member

It now gives

 type mismatch: got 'set[range 1..5(uint8)]' for 'x' but expected 'set[uint8]'

@metagn
Copy link
Collaborator Author

metagn commented Nov 22, 2021

Weird but separate issue

@metagn metagn closed this as completed Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants