'isolate' builtin; refs https://github.com/nim-lang/RFCs/issues/244 (#15011)
This commit is contained in:
parent
bb1adf6a70
commit
71dd5f85b9
9 changed files with 194 additions and 6 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue