diff options
author | Araq <rumpf_a@web.de> | 2017-11-23 01:22:12 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-11-23 01:22:12 +0100 |
commit | 6f69bdd3a047d4d959019556c1aabb725ad9221b (patch) | |
tree | affd4cd0f89d0cb44ee9cc00bab5f679078e0f09 /tests | |
parent | df13b2a89222c24474df454d0336f1f20162bdc7 (diff) | |
download | Nim-6f69bdd3a047d4d959019556c1aabb725ad9221b.tar.gz |
closes #6121
Diffstat (limited to 'tests')
-rw-r--r-- | tests/notnil/tmust_compile.nim | 21 |
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 |