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

@ -136,7 +136,7 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym)
return typeWithSonsResult(tyAnd, @[operand, operand2])
of "not":
return typeWithSonsResult(tyNot, @[operand])
of "name":
of "name", "$":
result = newStrNode(nkStrLit, operand.typeToString(preferTypeName))
result.typ = newType(tyString, context)
result.info = traitCall.info