diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/core/macros.nim | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/core/macros.nim b/lib/core/macros.nim index b26264405..18a70f20c 100644 --- a/lib/core/macros.nim +++ b/lib/core/macros.nim @@ -1582,11 +1582,9 @@ proc customPragmaNode(n: NimNode): NimNode = if n.kind in {nnkDotExpr, nnkCheckedFieldExpr}: let name = $(if n.kind == nnkCheckedFieldExpr: n[0][1] else: n[1]) - let typInst = getTypeInst(if n.kind == nnkCheckedFieldExpr or n[0].kind == nnkHiddenDeref: n[0][0] else: n[0]) - var typDef = getImpl( - if typInst.kind in {nnkVarTy, nnkBracketExpr}: typInst[0] - else: typInst - ) + var typInst = getTypeInst(if n.kind == nnkCheckedFieldExpr or n[0].kind == nnkHiddenDeref: n[0][0] else: n[0]) + while typInst.kind in {nnkVarTy, nnkBracketExpr}: typInst = typInst[0] + var typDef = getImpl(typInst) while typDef != nil: typDef.expectKind(nnkTypeDef) let typ = typDef[2].extractTypeImpl() |