summary refs log tree commit diff stats
path: root/compiler/semmagic.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2020-07-20 07:50:19 +0200
committerGitHub <noreply@github.com>2020-07-20 07:50:19 +0200
commit71dd5f85b9a13d97ea0c74338722bf08a9ae6286 (patch)
tree0c8757d1a835b334bcac8dc252622bd7b9073549 /compiler/semmagic.nim
parentbb1adf6a706190883fa57a0208ba8e3118235256 (diff)
downloadNim-71dd5f85b9a13d97ea0c74338722bf08a9ae6286.tar.gz
'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011)
Diffstat (limited to 'compiler/semmagic.nim')
-rw-r--r--compiler/semmagic.nim5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim
index e7a964d81..6aa440aa9 100644
--- a/compiler/semmagic.nim
+++ b/compiler/semmagic.nim
@@ -558,6 +558,9 @@ proc magicsAfterOverloadResolution(c: PContext, n: PNode,
     let constructed = result[1].typ.base
     if constructed.requiresInit:
       message(c.config, n.info, warnUnsafeDefault, typeToString(constructed))
+  of mIsolate:
+    if not checkIsolate(n[1]):
+      localError(c.config, n.info, "expression cannot be isolated: " & $n[1])
+    result = n
   else:
     result = n
-