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

Range type is considered as underlying type when invoking from generic #6013

Closed
endragor opened this issue Jun 22, 2017 · 3 comments · Fixed by #24525
Closed

Range type is considered as underlying type when invoking from generic #6013

endragor opened this issue Jun 22, 2017 · 3 comments · Fixed by #24525

Comments

@endragor
Copy link
Contributor

Sample:

type
  n16 = range[0'i16..high(int16)]
  SomeObj = ref object

proc doSomethingMore(idOrObj: n16 or SomeObj) =
  discard

proc doSomething(idOrObj: n16 or SomeObj) =
  doSomethingMore(idOrObj) # Error: type mismatch: got (int16)

doSomething(0.n16)

Git hash: 9d4aa03

@stale
Copy link

stale bot commented Aug 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.

@stale stale bot added the stale Staled PR/issues; remove the label after fixing them label Aug 4, 2020
@metagn
Copy link
Collaborator

metagn commented Sep 18, 2024

Should be same as #10027

@metagn metagn removed the stale Staled PR/issues; remove the label after fixing them label Sep 18, 2024
@metagn
Copy link
Collaborator

metagn commented Oct 2, 2024

Works since 1.6.14 actually, but using 0 instead of 0.n16 doesn't match doSomething for some weird unrelated typing reason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants