summary refs log tree commit diff stats
path: root/compiler/semstmts.nim
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/semstmts.nim')
-rw-r--r--compiler/semstmts.nim3
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