From 8e1b07975b4123323a6389556345296b85bdfa65 Mon Sep 17 00:00:00 2001 From: Felix Krause Date: Sat, 18 Mar 2023 14:50:38 +0100 Subject: [PATCH] Fixed a bug with objects with no fields * can now be loaded properly * ref #130 --- yaml/serialization.nim | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/yaml/serialization.nim b/yaml/serialization.nim index 315e24a..57a6d4b 100644 --- a/yaml/serialization.nim +++ b/yaml/serialization.nim @@ -635,8 +635,13 @@ proc fieldCount(t: NimNode): int {.compiletime.} = macro matchMatrix(t: typedesc): untyped = - result = newNimNode(nnkBracket) let numFields = fieldCount(t) + if numFields == 0: + result = quote do: + (seq[bool])(@[]) + return + + result = newNimNode(nnkBracket) for i in 0..