diff options
-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 |