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

Set + static (+ range ?): Ordinal type expected #7546

Closed
mratsim opened this issue Apr 8, 2018 · 3 comments
Closed

Set + static (+ range ?): Ordinal type expected #7546

mratsim opened this issue Apr 8, 2018 · 3 comments

Comments

@mratsim
Copy link
Collaborator

mratsim commented Apr 8, 2018

Using an int literal works, a static int throws ordinal type expected

type
  rangeA = range[0 .. 10]
  rangeB[N: static[int16]] = range[0'i16 .. N]

  setA = set[rangeA] # works
  setB[N: static[int16]] = set[rangeB] # Error: ordinal type expected

The range is guaranteed to fit in int16

@andreaferretti
Copy link
Collaborator

Shouldn't it be setB[N: static[int16]] = set[rangeB[N]]?

@metagn
Copy link
Collaborator

metagn commented Apr 9, 2018

Gives same error

@mratsim
Copy link
Collaborator Author

mratsim commented Apr 9, 2018

Ah yes indeed, that was what I actually tried on my computer and lost parts on cleanup.

cooldome added a commit that referenced this issue Nov 5, 2020
@Araq Araq closed this as completed in cdd459d Nov 6, 2020
narimiran pushed a commit that referenced this issue Nov 9, 2020
* close #9679

* close #7546

* close #9520

* close #6177

(cherry picked from commit cdd459d)
PMunch pushed a commit to PMunch/Nim that referenced this issue Jan 6, 2021
mildred pushed a commit to mildred/Nim that referenced this issue Jan 11, 2021
irdassis pushed a commit to irdassis/Nim that referenced this issue Mar 16, 2021
ardek66 pushed a commit to ardek66/Nim that referenced this issue Mar 26, 2021
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