mjsonutilssandwich.nim 300 B

123456789101112
  1. import std/[json, jsonutils]
  2. type
  3. Kind* = enum kind1
  4. Foo* = ref object
  5. bleh: string
  6. case kind*: Kind # Remove these lines and everything works 🤡
  7. of kind1: discard # Remove these lines and everything works 🤡
  8. proc unserialize*[T](s: string) =
  9. discard jsonTo(parseJson(s), T)