summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--compiler/sem.nim2
1 files changed, 2 insertions, 0 deletions
diff --git a/compiler/sem.nim b/compiler/sem.nim
index ccbd665e9..b713dbbbb 100644
--- a/compiler/sem.nim
+++ b/compiler/sem.nim
@@ -443,6 +443,8 @@ proc isImportSystemStmt(n: PNode): bool =
   else: discard
 
 proc semStmtAndGenerateGenerics(c: PContext, n: PNode): PNode =
+  if n.kind == nkDefer:
+    localError(n.info, "defer statement not supported at top level")
   if c.topStmts == 0 and not isImportSystemStmt(n):
     if sfSystemModule notin c.module.flags and
         n.kind notin {nkEmpty, nkCommentStmt}:
p/.traces/copy_handles_nested_record_elements?h=main&id=088665eff883b5bc28022800aed27f6af468a4ba'>088665ef ^
62ed0e47 ^
088665ef ^

62ed0e47 ^
844697c2 ^

62ed0e47 ^





















1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34