mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-29 17:34:43 +00:00
* test removing dollar for objects out of system * test & fixes * fix bootstrap * use nimPreviewSlimSystem, test stdlib category * fix test
12 lines
310 B
Nim
12 lines
310 B
Nim
import std/private/miscdollars
|
|
|
|
proc `$`*[T: object](x: T): string =
|
|
## Generic `$` operator for objects with similar output to
|
|
## `$` for named tuples.
|
|
runnableExamples:
|
|
type Foo = object
|
|
a, b: int
|
|
let x = Foo(a: 23, b: 45)
|
|
assert $x == "(a: 23, b: 45)"
|
|
tupleObjectDollar(result, x)
|