Custom pragmas in proc types (#8205)

This commit is contained in:
cooldome 2018-07-09 12:11:03 +02:00 • committed by Andreas Rumpf
commit dec97924a4
5 changed files with 30 additions and 14 deletions

View file

@ -1284,7 +1284,9 @@ proc customPragmaNode(n: NimNode): NimNode =
let
typ = n.getTypeInst()
if typ.typeKind == ntyTypeDesc:
if typ.kind == nnkBracketExpr and typ.len > 1 and typ[1].kind == nnkProcTy:
return typ[1][1]
elif typ.typeKind == ntyTypeDesc:
let impl = typ[1].getImpl()
if impl[0].kind == nnkPragmaExpr:
return impl[0][1]