diff options
author | metagn <metagngn@gmail.com> | 2022-09-11 09:33:24 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-11 08:33:24 +0200 |
commit | 58e6d439d88fcac4950b1de80af96234688f056b (patch) | |
tree | 72082621eb08b85571572c576e6e1e2844479832 /compiler | |
parent | 884f1f6b11e3dc8d57ffa6f393d8cdd9d70dded0 (diff) | |
download | Nim-58e6d439d88fcac4950b1de80af96234688f056b.tar.gz |
fix #13515 [backport] (#20315)
* fix #13515 * only compile test * no idea why this PR is unlocking this * don't rope in symchoices * even more restrictive
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semtempl.nim | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/semtempl.nim b/compiler/semtempl.nim index 6b71892a0..2d5f077f9 100644 --- a/compiler/semtempl.nim +++ b/compiler/semtempl.nim @@ -250,8 +250,14 @@ proc semTemplSymbol(c: PContext, n: PNode, s: PSym; isField: bool): PNode = of skUnknown: # Introduced in this pass! Leave it as an identifier. result = n - of OverloadableSyms: + of OverloadableSyms-{skTemplate,skMacro}: result = symChoice(c, n, s, scOpen, isField) + of skTemplate, skMacro: + result = symChoice(c, n, s, scOpen, isField) + if result.kind == nkSym: + # template/macro symbols might need to be semchecked again + # prepareOperand etc don't do this without setting the type to nil + result.typ = nil of skGenericParam: if isField and sfGenSym in s.flags: result = n else: result = newSymNodeTypeDesc(s, c.idgen, n.info) |