fixes #21638; fromJson should support empty objects (#21641)

* fixes #21638; `fromJson` should supports empty objects

* complete the logic

(cherry picked from commit 5e016e4466)
This commit is contained in:
ringabout
2023-04-11 12:38:30 +08:00
committed by narimiran
parent ed21e84f46
commit 6f05abf21c
2 changed files with 21 additions and 11 deletions

View File

@@ -409,6 +409,11 @@ template fn() =
doAssert foo.c == 0
doAssert foo.c0 == 42
block: # bug #21638
type Something = object
doAssert "{}".parseJson.jsonTo(Something) == Something()
when false:
## TODO: Implement support for nested variant objects allowing the tests
## bellow to pass.