-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
future/sugar =>
syntax breaks with generics
#7816
Comments
This is a though one. Can I have the commit that introduced the regression please? |
I tried to find it, but even this is tough :). The exact example I have given also seems to fail with fairly old versions of Nim. I have some other variants of this failure, I'll have to see if I can bisect them. Maybe it isn't a regression after all, and I just happened to run into it much more often now... |
@bluenote10 @Araq I doubt it ever worked; but my PR #8679 will fix this: when defined(case2):
import sequtils
import sugar
proc tester[T](x: T) =
let test = toSeq(0..5).map(i => newSeq[int]())
echo test
tester(1)
when defined(case3):
import sequtils
proc tester[T](x: T) =
let test = toSeq(0..5).map2(i => newSeq[int]()) # pending renaming map2 to map
echo test
tester(1) rnim -d:case2 tests/nim/lambda/t01_lambda_exp3.nim @[@[], @[], @[], @[], @[], @[]] |
Recently I'm getting all kinds of compilation errors when using the future/sugar
=>
syntax. I now noticed that it is related to generic procs:Error:
The expression does work when it appears in a non-generic context, and I'm pretty sure such code used to work before.
The text was updated successfully, but these errors were encountered: