diff options
author | Timothee Cour <timothee.cour2@gmail.com> | 2018-12-29 16:09:47 -0800 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-12-30 01:09:47 +0100 |
commit | 083129286349ba440018cff1ed20172b675b84fe (patch) | |
tree | 812b2c252fd8947f6e5546991e5c6220703bfc9d /tests/system | |
parent | eba8ffcf70cca5dd802c5d33f6ecea814829f9fc (diff) | |
download | Nim-083129286349ba440018cff1ed20172b675b84fe.tar.gz |
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
Diffstat (limited to 'tests/system')
-rw-r--r-- | tests/system/tsystem_misc.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/system/tsystem_misc.nim b/tests/system/tsystem_misc.nim index 3bbb5eff1..98bc3f4a3 100644 --- a/tests/system/tsystem_misc.nim +++ b/tests/system/tsystem_misc.nim @@ -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) |