-
-
Notifications
You must be signed in to change notification settings - Fork 96
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
Span slicing inside dynamic type procs fails to compile #43
Comments
I've reproduced it and reported it to Nim upstream. It seems like for generic procs, there is an identifier resolution happening before the macros kick-in and replace "_". I may have a workaround by exporting a dummy "_" but I don't want to pollute namespace with that symbol. And it's used in tuple pattern-matching as well and maybe by other libs. |
You can workaround that issue by using |
This workaround does not work with more complex silicing, like |
Not sure which identifier poses the issue here, with seq I can "solve" it by adding everything as mixin :/ proc foo4[T](): CustomSeq[T] =
result.data.newSeq(10)
# weird fancy corner case that feels special and wants special treatment
mixin _,`|-`
# why?
echo result[_, _, ^1..0|-1] Case is closed upstream, but I really think generics have an issue as detailed by Krux |
Minor test case:
When compiling the following error is shown:
Removing dynamic type
[T]
from the proc the code works fine.The text was updated successfully, but these errors were encountered: