diff options
author | Zahary Karadjov <zahary@gmail.com> | 2017-04-07 23:18:14 +0300 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2017-04-08 17:28:19 +0300 |
commit | e9a3ffbc3d318911da5c46582a70288dd16275f3 (patch) | |
tree | 8b9f8c8b1cc9afc25cb7d0a9b218ea7ee4f6bcdd /compiler/vm.nim | |
parent | fceef773015bd7f764c51549ec20768b5e9f5eb1 (diff) | |
download | Nim-e9a3ffbc3d318911da5c46582a70288dd16275f3.tar.gz |
Restore the Nim's 0.14 proper handling of generic aliases
A more efficient implementation is possible by restoring the old lifting ot tyGenericInvocation to tyGenericInst in liftTypeParam, but this fix will suffice for now. fixes #5087 fixes #5602 fixes #5641 fixes #5570
Diffstat (limited to 'compiler/vm.nim')
-rw-r--r-- | compiler/vm.nim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/vm.nim b/compiler/vm.nim index 6a9545193..14800fb13 100644 --- a/compiler/vm.nim +++ b/compiler/vm.nim @@ -1606,6 +1606,12 @@ proc setupMacroParam(x: PNode, typ: PType): TFullReg = n.typ = x.typ result.node = n +iterator genericParamsInMacroCall*(macroSym: PSym, call: PNode): (PSym, PNode) = + let gp = macroSym.ast[genericParamsPos] + for i in 0 .. <gp.len: + let idx = macroSym.typ.len + i + yield (gp[i].sym, call.sons[idx]) + var evalMacroCounter: int proc evalMacroCall*(module: PSym; cache: IdentCache, n, nOrig: PNode, |