diff options
Diffstat (limited to 'compiler/semstmts.nim')
-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 10c74e7ea..3fbb6f8f3 100644 --- a/compiler/semstmts.nim +++ b/compiler/semstmts.nim @@ -786,7 +786,8 @@ proc semProcAnnotation(c: PContext, prc: PNode; result = semStmt(c, x) # since a proc annotation can set pragmas, we process these here again. # This is required for SqueakNim-like export pragmas. - if result[namePos].kind == nkSym and result[pragmasPos].kind != nkEmpty: + if result.kind in procDefs and result[namePos].kind == nkSym and + result[pragmasPos].kind != nkEmpty: pragma(c, result[namePos].sym, result[pragmasPos], validPragmas) return |