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

Closed
jxy opened this issue Jan 23, 2016 · 1 comment

Comments

Projects
None yet
4 participants
@jxy
Copy link
Contributor

commented Jan 23, 2016

Here is a undesirable behavior of static[T]

type
  R = range[0..2]
# echo 3.R                        # compiler errors correctly
type
  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
@narimiran

This comment has been minimized.

Copy link
Member

commented Feb 13, 2019

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