diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 63b3382a8e..d493364eac 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -2019,6 +2019,9 @@ proc semProcAux(c: PContext, n: PNode, kind: TSymKind, s.ast = n s.options = c.config.options #s.scope = c.currentScope + if s.kind in {skMacro, skTemplate}: + # push noalias flag at first to prevent unwanted recursive calls: + incl(s.flags, sfNoalias) # before compiling the proc params & body, set as current the scope # where the proc was declared @@ -2335,16 +2338,16 @@ proc semMacroDef(c: PContext, n: PNode): PNode = var s = result[namePos].sym var t = s.typ var allUntyped = true - var requiresParams = false + var nullary = true for i in 1..