-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Description
refs #18172 (comment)
Example
when true:
import std/sharedtables
var table: SharedTable[string, string]
init(table)
table["a"] = "x"
table["b"] = "y"
table["c"] = "z"
table.withValue("a", value):
value[] = "m"
table.withValue("d", value):
discard value
doAssert false
do: # if "d" notin table
table["d"] = "n"
assert table.mget("a") == "m"
assert table.mget("d") == "n"Current Output
hangs, after ^C I get:
Traceback (most recent call last)
/Users/timothee/git_clone/nim/timn/tests/nim/all/t12358.nim(22) t12358
/Users/timothee/git_clone/nim/Nim_devel/lib/pure/collections/sharedtables.nim(57) []=
SIGINT: Interrupted by Ctrl-C.
Expected Output
works
Additional Information
- 1.5.1 654a201
- after fixing, workaround bug in sharedtables.withValue to unblock frozen CI on OSX #18172 should be reverted
- sharedtables does not have pairs or keys iterator #17697 was tracking a different problem with withValue, so i didnt' merge it in that issue