summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2019-02-05 15:24:19 +0100
committerAndreas Rumpf <rumpf_a@web.de>2019-02-06 11:34:55 +0100
commit26255c72fd94da57c7208dc84e027a5de6693605 (patch)
tree5da2378b6ade6d3b151902f881e8a1bde67ee1d6 /lib
parentc174d0924553a4a5252f42b39d2163053e8ea359 (diff)
downloadNim-26255c72fd94da57c7208dc84e027a5de6693605.tar.gz
Fix getCustomPragmaVal on `var` fields
Diffstat (limited to 'lib')
-rw-r--r--lib/core/macros.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim
index 3a85324ba..d0b02fb05 100644
--- a/lib/core/macros.nim
+++ b/lib/core/macros.nim
@@ -1415,7 +1415,8 @@ proc customPragmaNode(n: NimNode): NimNode =
 
   if n.kind in {nnkDotExpr, nnkCheckedFieldExpr}:
     let name = $(if n.kind == nnkCheckedFieldExpr: n[0][1] else: n[1])
-    var typDef = getImpl(getTypeInst(if n.kind == nnkCheckedFieldExpr or n[0].kind == nnkHiddenDeref: n[0][0] else: n[0]))
+    let typInst = getTypeInst(if n.kind == nnkCheckedFieldExpr or n[0].kind == nnkHiddenDeref: n[0][0] else: n[0])
+    var typDef = getImpl(if typInst.kind == nnkVarTy: typInst[0] else: typInst)
     while typDef != nil:
       typDef.expectKind(nnkTypeDef)
       let typ = typDef[2]