diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2020-03-24 02:14:49 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 10:14:49 +0100 |
commit | 46c827be6a959be3d3bb840d1582bac8fc55bda6 (patch) | |
tree | 13be6161a0cd1aa0b45add5053ed76f258934b74 /compiler | |
parent | 5300baae062b892bb133850d88428a34d66592ed (diff) | |
download | Nim-46c827be6a959be3d3bb840d1582bac8fc55bda6.tar.gz |
fix #13737 (#13738)
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/semstmts.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim index 30f14b524..6b01e241b 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -452,7 +452,8 @@ proc semLowerLetVarCustomPragma(c: PContext, a: PNode, n: PNode): PNode = return nil let sym = searchInScopes(c, ident) - if sfCustomPragma in sym.flags: return nil # skip `template myAttr() {.pragma.}` + if sym == nil or sfCustomPragma in sym.flags: return nil + # skip if not in scope; skip `template myAttr() {.pragma.}` let lhs = b[0] let clash = strTableGet(c.currentScope.symbols, lhs.ident) if clash != nil: |