diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2016-07-11 20:45:28 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-11 20:45:28 +0200 |
commit | 51c77e09fdad00f1ca51f6464eb3feb5297bb336 (patch) | |
tree | 34faa653fa94e5878c7afc2dd66e3f9d171206bf | |
parent | fba673ce150754298ea2f582868feb6831ed07c9 (diff) | |
parent | 023f1da40a1343dab0e3d8d2f1ef3bf08b55f91a (diff) | |
download | Nim-51c77e09fdad00f1ca51f6464eb3feb5297bb336.tar.gz |
Merge pull request #4477 from kierdavis/4475-segfault
Fix #4475
-rw-r--r-- | compiler/sigmatch.nim | 4 | ||||
-rw-r--r-- | tests/overload/tissue4475.nim | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index 511a44954..8c8c83d0f 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -1746,8 +1746,8 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) = if formal.ast == nil: if formal.typ.kind == tyVarargs: var container = newNodeIT(nkBracket, n.info, arrayConstr(c, n.info)) - addSon(m.call, implicitConv(nkHiddenStdConv, formal.typ, - container, m, c)) + setSon(m.call, formal.position + 1, + implicitConv(nkHiddenStdConv, formal.typ, container, m, c)) else: # no default value m.state = csNoMatch diff --git a/tests/overload/tissue4475.nim b/tests/overload/tissue4475.nim new file mode 100644 index 000000000..34618cac5 --- /dev/null +++ b/tests/overload/tissue4475.nim @@ -0,0 +1,6 @@ +# Bug: https://github.com/nim-lang/Nim/issues/4475 +# Fix: https://github.com/nim-lang/Nim/pull/4477 + +proc test(x: varargs[string], y: int) = discard + +test(y = 1) |