revives: Move typetraits.$ to system. Fixes #5827 (#10071)

* 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:
Timothee Cour 2018-12-29 16:09:47 -08:00 • committed by Andreas Rumpf
commit 0831292863
4 changed files with 44 additions and 25 deletions

View file

@ -30,6 +30,20 @@ discard """
'''
"""
block:
const a2 = $(int)
const a3 = $int
doAssert a2 == "int"
doAssert a3 == "int"
proc fun[T: typedesc](t: T) =
const a2 = $(t)
const a3 = $t
doAssert a2 == "int"
doAssert a3 == "int"
fun(int)
# check high/low implementations
doAssert high(int) > low(int)
doAssert high(int8) > low(int8)