warn about observerable stores but don't prevent them for 1.2.2 [backport:1.2]; refs https://github.com/nim-lang/RFCs/issues/230 (#14510)
This commit is contained in:
parent
7ccc7d7e93
commit
52c3633223
3 changed files with 15 additions and 8 deletions
|
|
@ -43,8 +43,9 @@ proc preventNrvo(p: BProc; le, ri: PNode): bool =
|
|||
for i in 1..<ri.len:
|
||||
let r = ri[i]
|
||||
if isPartOf(le, r) != arNo: return true
|
||||
return canRaiseDisp(p, ri[0]) and
|
||||
(p.nestedTryStmts.len > 0 or locationEscapes(p, le))
|
||||
if canRaiseDisp(p, ri[0]) and
|
||||
(p.nestedTryStmts.len > 0 or locationEscapes(p, le)):
|
||||
message(p.config, le.info, warnObservableStores, $le)
|
||||
|
||||
proc hasNoInit(call: PNode): bool {.inline.} =
|
||||
result = call[0].kind == nkSym and sfNoInit in call[0].sym.flags
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue