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

Varargs with array ignores leading arguments. #8172

Closed
Quelklef opened this issue Jul 1, 2018 · 2 comments
Closed

Varargs with array ignores leading arguments. #8172

Quelklef opened this issue Jul 1, 2018 · 2 comments

Comments

@Quelklef
Copy link
Contributor

Quelklef commented Jul 1, 2018

proc f(v: varargs[string]) =
    echo(v)

f("a", ["b", "c"])

Outputs ["b", "c"].

@Quelklef
Copy link
Contributor Author

Quelklef commented Jul 1, 2018

Possibly related to #7914

@Quelklef Quelklef changed the title Varargs ignores leading arguments. Varargs with array ignores leading arguments. Jul 1, 2018
@LemonBoy
Copy link
Contributor

LemonBoy commented Jul 2, 2018

The problem here is that varargs[string] and array[2, string] are linked by a isConvertible relationship and matchesAux is confused by this: it first creates a nkBracket with "a" in it and then overwrites it with the second argument.

I'll take care of this later if nobody else steps up.

LemonBoy added a commit to LemonBoy/Nim that referenced this issue Jul 2, 2018
LemonBoy added a commit to LemonBoy/Nim that referenced this issue Jul 2, 2018
@Araq Araq closed this as completed in #8186 Jul 3, 2018
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