fixes #3836
This commit is contained in:
parent
92cf673f37
commit
00c4861208
1 changed files with 7 additions and 4 deletions
|
|
@ -1589,8 +1589,11 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
|
||||||
m.state = csNoMatch
|
m.state = csNoMatch
|
||||||
return
|
return
|
||||||
if containsOrIncl(marker, formal.position):
|
if containsOrIncl(marker, formal.position):
|
||||||
# already in namedParams:
|
# already in namedParams, so no match
|
||||||
localError(n.sons[a].info, errCannotBindXTwice, formal.name.s)
|
# we used to produce 'errCannotBindXTwice' here but see
|
||||||
|
# bug #3836 of why that is not sound (other overload with
|
||||||
|
# different parameter names could match later on):
|
||||||
|
when false: localError(n.sons[a].info, errCannotBindXTwice, formal.name.s)
|
||||||
m.state = csNoMatch
|
m.state = csNoMatch
|
||||||
return
|
return
|
||||||
m.baseTypeMatch = false
|
m.baseTypeMatch = false
|
||||||
|
|
@ -1647,8 +1650,8 @@ proc matchesAux(c: PContext, n, nOrig: PNode,
|
||||||
return
|
return
|
||||||
formal = m.callee.n.sons[f].sym
|
formal = m.callee.n.sons[f].sym
|
||||||
if containsOrIncl(marker, formal.position) and container.isNil:
|
if containsOrIncl(marker, formal.position) and container.isNil:
|
||||||
# already in namedParams:
|
# already in namedParams: (see above remark)
|
||||||
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
|
||||||
m.baseTypeMatch = false
|
m.baseTypeMatch = false
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue