tobjectdollar.nim 237 B

123456789101112131415
  1. discard """
  2. matrix: "-d:nimPreviewSlimSystem"
  3. """
  4. import std/assertions
  5. type Foo = object
  6. a, b: int
  7. let x = Foo(a: 23, b: 45)
  8. doAssert not compiles($x)
  9. import std/objectdollar
  10. doAssert compiles($x)
  11. doAssert $x == "(a: 23, b: 45)"