From d938c6411e399ee1c936fa7b9ee3a1b53ab65791 Mon Sep 17 00:00:00 2001 From: cooldome Date: Wed, 16 Sep 2020 20:37:23 +0100 Subject: [PATCH] fix #15326 (#15341) --- compiler/semtypes.nim | 118 +++++++++++++++++++++------------------ tests/macros/tmacro2.nim | 8 +++ 2 files changed, 71 insertions(+), 55 deletions(-) diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim index d85008342..4d912a46f 100644 --- a/compiler/semtypes.nim +++ b/compiler/semtypes.nim @@ -2055,72 +2055,80 @@ proc semGenericConstraints(c: PContext, x: PType): PType = result = newTypeWithSons(c, tyGenericParam, @[x]) proc semGenericParamList(c: PContext, n: PNode, father: PType = nil): PNode = + + template addSym(result: PNode, s: PSym): untyped = + if father != nil: addSonSkipIntLit(father, s.typ) + if sfGenSym notin s.flags: addDecl(c, s) + result.add newSymNode(s) + result = copyNode(n) if n.kind != nkGenericParams: illFormedAst(n, c.config) return for i in 0..