* Move typetraits.`$` to system. Fixes #5827. * revive PR; adjust code to make sure everything works and add tests * fix tests/concepts/tstackconcept.nim * address comments
This commit is contained in:
parent
eba8ffcf70
commit
0831292863
4 changed files with 44 additions and 25 deletions
|
|
@ -4431,3 +4431,12 @@ when defined(genode):
|
|||
componentConstructHook(env)
|
||||
# Perform application initialization
|
||||
# and return to thread entrypoint.
|
||||
|
||||
proc `$`*(t: typedesc): string {.magic: "TypeTrait".} =
|
||||
## Returns the name of the given type.
|
||||
##
|
||||
## For more procedures dealing with ``typedesc``, see ``typetraits.nim``.
|
||||
runnableExamples:
|
||||
doAssert $(type(42)) == "int"
|
||||
doAssert $(type("Foo")) == "string"
|
||||
static: doAssert $(type(@['A', 'B'])) == "seq[char]"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue