-
-
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
pass varargs[seq[T]] to iterator give empty seq #12576
Labels
Comments
The program run fine with v0.20.0 and breaks with v0.20.2. |
The following code in proc putArgInto(arg: PNode, formal: PType): TPutArgInto =
# This analyses how to treat the mapping "formal <-> arg" in an
# inline context.
if formal.kind == tyTypeDesc: return paDirectMapping
if skipTypes(formal, abstractInst).kind in {tyOpenArray, tyVarargs}:
case arg.kind
of nkStmtListExpr:
return paComplexOpenarray
of nkBracket:
return paFastAsgnTakeTypeFromArg # oops
else:
return paDirectMapping # XXX really correct?
# what if ``arg`` has side-effects?
|
It is caused by fixing issue #8316. |
ghost
added
the
varargs
label
Jul 27, 2020
ghost
mentioned this issue
Jul 27, 2020
mildred
pushed a commit
to mildred/Nim
that referenced
this issue
Jan 11, 2021
* Add a test-case for nim-lang#12576 * Add a test-case for nim-lang#12523
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When pass varargs[seq[T]] to iterator, only the first arg is valid, the following is always empty.
Example
Current Output
Expected Output
The text was updated successfully, but these errors were encountered: