diff options
author | Zahary Karadjov <zahary@gmail.com> | 2018-06-16 03:51:31 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2018-06-16 16:46:32 +0300 |
commit | 31651ecd613b7fddea037cb0cc7d433bec6c902d (patch) | |
tree | 8e6560fa2fb73642857be1edeff6d72c5fba49d8 /compiler/semcall.nim | |
parent | e719f211c634d2be7b5ae118db7051a2382a8e3e (diff) | |
download | Nim-31651ecd613b7fddea037cb0cc7d433bec6c902d.tar.gz |
allow referencing other parameters in default parameter values
fix #7756 fix #1201 fix #7000 fix #3002 fix #1046
Diffstat (limited to 'compiler/semcall.nim')
-rw-r--r-- | compiler/semcall.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 0de22cfb3..67fe99232 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -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 = |