allow referencing other parameters in default parameter values
fix #7756 fix #1201 fix #7000 fix #3002 fix #1046
This commit is contained in:
parent
e719f211c6
commit
31651ecd61
10 changed files with 244 additions and 31 deletions
|
|
@ -2366,7 +2366,8 @@ proc matches*(c: PContext, n, nOrig: PNode, m: var TCandidate) =
|
|||
m.firstMismatch = f
|
||||
break
|
||||
else:
|
||||
# use default value:
|
||||
if nfDefaultRefsParam in formal.ast.flags:
|
||||
m.call.flags.incl nfDefaultRefsParam
|
||||
var def = copyTree(formal.ast)
|
||||
if def.kind == nkNilLit:
|
||||
def = implicitConv(nkHiddenStdConv, formal.typ, def, m, c)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue