-
-
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
Underscore cannot be defined more than once in proc #13443
Comments
Maybe this works as expected? error: redefinition of parameter '_'
N_LIB_PRIVATE N_NIMCALL(void, foo__BOpZ9bkFh9cyFk2iF9aui4mXw)(NI _, NI windx, NI _); If the Maybe this needs to be documented instead of being fixed? |
for consistency with (EDIT) #15972, IMO |
@timotheecour If mangling underscore names is more consistent, I will try that. |
@xflywind thx, fixed link |
Because JS backend mangles function parameters, it does work in JS backend and VM. proc foo(_, _: int) = echo "123"
foo(1, 2) function foo_385875969(__385875971, __385875972) {
rawEcho(makeNimstrLit("123"));
}
foo_385875969(1, 2); |
this should probably be legal: proc foo(_, _: int) = discard this should not be legal: proc main(_: int) = echo _ see also nim-lang/RFCs#292 which defines a useful use case for passing |
fixes nim-lang#13443, fixes nim-lang#13804, refs nim-lang#21121
* underscores for routine parameters fixes nim-lang#13443, fixes nim-lang#13804, refs nim-lang#21121 * add changelog + more tests * support generics and ensure inferred lambdas work
* underscores for routine parameters fixes nim-lang#13443, fixes nim-lang#13804, refs nim-lang#21121 * add changelog + more tests * support generics and ensure inferred lambdas work
* underscores for routine parameters fixes nim-lang#13443, fixes nim-lang#13804, refs nim-lang#21121 * add changelog + more tests * support generics and ensure inferred lambdas work
Test
Expected
Compiles with no issue. It works for one underscore, though I'm not sure this is even a feature.
Got
The text was updated successfully, but these errors were encountered: