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

static range type bounds not checked when conversion from intLit #3766

jxy opened this issue Jan 23, 2016 · 1 comment


None yet
4 participants
Copy link

commented Jan 23, 2016

Here is a undesirable behavior of static[T]

  R = range[0..2]
# echo 3.R                        # compiler errors correctly
  T[n: static[R]] = object
  V = T[3.R]                    # compiler erroneously allows
echo V.n
proc r(x: static[R]) =
  echo x
r 3.R                           # compiler erroneously allows

This comment has been minimized.

Copy link

commented Feb 13, 2019

 R = range[0..2]
# echo 3.R                        # compiler errors correctly

Currently (Nim 0.19.9), this is also allowed :/

GULPF added a commit to GULPF/Nim that referenced this issue May 14, 2019

@Araq Araq closed this in #11252 May 15, 2019

Araq added a commit that referenced this issue May 15, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.