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

TSlice returned by template as an expr does not work in range[] #560

Open
dom96 opened this issue Aug 4, 2013 · 3 comments
Open

TSlice returned by template as an expr does not work in range[] #560

dom96 opened this issue Aug 4, 2013 · 3 comments

Comments

@dom96
Copy link
Contributor

dom96 commented Aug 4, 2013

template test(): expr =
  2 .. 6

var x: range[test()] = 5

Does not work.

@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 Dec 22, 2020

Still valid but there might be duplicate or more general issues. I wouldn't say this is low priority more like convenience syntax

@stale stale bot removed the stale Staled PR/issues; remove the label after fixing them label Dec 22, 2020
@ringabout
Copy link
Member

range is bit hack, it is handled by semcheck.

Clyybber pushed a commit to Clyybber/Nim that referenced this issue Sep 16, 2023
560: lexer: smaller diag type and drop internal error r=saem a=saem

## Summary
Internal changes:
- `LexDiag` is now a smaller type
- removed the `lexDiagInternalError`

## Details

Smaller Diag Type:
- `lexDiagNameXShouldBeY` resuse the `msg` field for 'Y' (wanted)
- this reduces the variant by a `string`

Drop Internal Error:
- eliminated `lexDiagInternalError`
- all cases were guarded and are now handled by `unreachable`
- also removes the need to wrap token fetching in try/except

Misc:
- More specific diagnostic kinds for invalid integer vs numeric literals
- Messages remain unchanged, however
- Minor style clean-ups

This is made possible thanks to more specific diag kinds that have reduced or deferred many string allocs.



Co-authored-by: Saem Ghani <saemghani [email protected]>
@metagn metagn added the Feature label Aug 29, 2024
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