fixes a varargs[untyped] bug that kept strscans from compiling
This commit is contained in:
parent
b357e80833
commit
875132bf46
1 changed files with 29 additions and 20 deletions
|
|
@ -1659,6 +1659,15 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
|
||||||
when false: localError(n.sons[a].info, errCannotBindXTwice, formal.name.s)
|
when false: localError(n.sons[a].info, errCannotBindXTwice, formal.name.s)
|
||||||
m.state = csNoMatch
|
m.state = csNoMatch
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if formal.typ.isVarargsUntyped:
|
||||||
|
if container.isNil:
|
||||||
|
container = newNodeIT(nkBracket, n.sons[a].info, arrayConstr(c, n.info))
|
||||||
|
setSon(m.call, formal.position + 1, container)
|
||||||
|
else:
|
||||||
|
incrIndexType(container.typ)
|
||||||
|
addSon(container, n.sons[a])
|
||||||
|
else:
|
||||||
m.baseTypeMatch = false
|
m.baseTypeMatch = false
|
||||||
n.sons[a] = prepareOperand(c, formal.typ, n.sons[a])
|
n.sons[a] = prepareOperand(c, formal.typ, n.sons[a])
|
||||||
var arg = paramTypesMatch(m, formal.typ, n.sons[a].typ,
|
var arg = paramTypesMatch(m, formal.typ, n.sons[a].typ,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue