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
|
|
@ -402,7 +402,9 @@ proc updateDefaultParams(call: PNode) =
|
|||
for i in countdown(call.len - 1, 1):
|
||||
if nfDefaultParam notin call[i].flags:
|
||||
return
|
||||
call[i] = calleeParams[i].sym.ast
|
||||
let def = calleeParams[i].sym.ast
|
||||
if nfDefaultRefsParam in def.flags: call.flags.incl nfDefaultRefsParam
|
||||
call[i] = def
|
||||
|
||||
proc semResolvedCall(c: PContext, x: TCandidate,
|
||||
n: PNode, flags: TExprFlags): PNode =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue