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:
Andreas Rumpf 2020-05-30 19:38:51 +02:00 • committed by GitHub
commit 52c3633223
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 8 deletions

View file

@ -4,9 +4,9 @@ obj.inner.id = 7
id = 7
obj = (inner: (kind: Just, id: 7))
2
(a: "1", b: "2", c: "3")
(a: "a", b: "b", c: "")
caught
(a: "1", b: "", c: "3")'''
(a: "a", b: "b", c: "")'''
"""
# bug #6960
@ -164,7 +164,8 @@ proc ohmanNoNRVO =
discard
echo x
doAssert x.c == "3", "shouldn't modify x if f raises"
# once NVRO is sorted out, x.c == "3"
doAssert x.c == "", "shouldn't modify x if f raises"
ohmanNoNRVO()
@ -179,4 +180,5 @@ try:
except:
echo "caught"
echo xgg
doAssert xgg.c == "3", "this assert will fail"
# once NVRO is sorted out, xgg.c == "3"
doAssert xgg.c == "", "this assert will fail"