mirror of
https://github.com/nim-lang/Nim.git
synced 2026-07-29 19:57:58 +00:00
typeToString: type float => typedesc[float] (#17011)
* typeToString: type float => typedesc[float] * fixup * fix tests
This commit is contained in:
@@ -448,6 +448,7 @@ proc rangeToStr(n: PNode): string =
|
||||
const
|
||||
typeToStr: array[TTypeKind, string] = ["None", "bool", "char", "empty",
|
||||
"Alias", "typeof(nil)", "untyped", "typed", "typeDesc",
|
||||
# xxx typeDesc=>typedesc: typedesc is declared as such, and is 10x more common.
|
||||
"GenericInvocation", "GenericBody", "GenericInst", "GenericParam",
|
||||
"distinct $1", "enum", "ordinal[$1]", "array[$1, $2]", "object", "tuple",
|
||||
"set[$1]", "range[$1]", "ptr ", "ref ", "var ", "seq[$1]", "proc",
|
||||
@@ -550,7 +551,7 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string =
|
||||
result.add(']')
|
||||
of tyTypeDesc:
|
||||
if t[0].kind == tyNone: result = "typedesc"
|
||||
else: result = "type " & typeToString(t[0])
|
||||
else: result = "typedesc[" & typeToString(t[0]) & "]"
|
||||
of tyStatic:
|
||||
if prefer == preferGenericArg and t.n != nil:
|
||||
result = t.n.renderTree
|
||||
|
||||
Reference in New Issue
Block a user