summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-11-23 01:22:12 +0100
committerAraq <rumpf_a@web.de>2017-11-23 01:22:12 +0100
commit6f69bdd3a047d4d959019556c1aabb725ad9221b (patch)
treeaffd4cd0f89d0cb44ee9cc00bab5f679078e0f09 /tests
parentdf13b2a89222c24474df454d0336f1f20162bdc7 (diff)
downloadNim-6f69bdd3a047d4d959019556c1aabb725ad9221b.tar.gz
closes #6121
Diffstat (limited to 'tests')
-rw-r--r--tests/notnil/tmust_compile.nim21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/notnil/tmust_compile.nim b/tests/notnil/tmust_compile.nim
index 83c8ff92b..f4ac3724f 100644
--- a/tests/notnil/tmust_compile.nim
+++ b/tests/notnil/tmust_compile.nim
@@ -35,3 +35,24 @@ type
 
 let table = newTable[string, Task]()
 table.del("task")
+
+# bug #6121
+
+import json
+
+type
+
+  foo = object
+    thing: string not nil
+
+  CTS = ref object
+    subs_by_sid: Table[int, foo]
+
+
+proc parse(cts: CTS, jn: JsonNode) =
+
+  let ces = foo(
+    thing: jn.getStr("thing")
+  )
+
+  cts.subs_by_sid[0] = ces
\ No newline at end of file