summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-06-05 03:41:13 +0800
committerGitHub <noreply@github.com>2021-06-04 12:41:13 -0700
commita77360da5bad40d22e942cdd5cb9614c3548bf34 (patch)
tree5a0271c37a4ab57473f305d45c5f8e0a96ac8cdb
parent5423915e5ade14fb98c2aba28f269311506960e5 (diff)
downloadNim-a77360da5bad40d22e942cdd5cb9614c3548bf34.tar.gz
workaround bug in sharedtables.withValue to unblock frozen CI on OSX (#18172)
-rw-r--r--lib/pure/collections/sharedtables.nim4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pure/collections/sharedtables.nim b/lib/pure/collections/sharedtables.nim
index 2788ec785..a85674df9 100644
--- a/lib/pure/collections/sharedtables.nim
+++ b/lib/pure/collections/sharedtables.nim
@@ -108,10 +108,14 @@ template withValue*[A, B](t: var SharedTable[A, B], key: A,
     table.withValue("a", value):
       value[] = "m"
 
+    var flag = false
     table.withValue("d", value):
       discard value
       doAssert false
     do: # if "d" notin table
+      flag = true
+
+    if flag:
       table["d"] = "n"
 
     assert table.mget("a") == "m"