From 71dd5f85b9a13d97ea0c74338722bf08a9ae6286 Mon Sep 17 00:00:00 2001 From: Andreas Rumpf Date: Mon, 20 Jul 2020 07:50:19 +0200 Subject: 'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011) --- compiler/semmagic.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'compiler/semmagic.nim') 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 - -- cgit 1.4.1-2-gfad0