fix #13432 typetraits.$: $(int,) is now (int,); $tuple[] is now tuple[] (#14799)

* typetraits.$: $(int,) is now (int,); $tuple[] is now tuple[]

* changelog
This commit is contained in:
Timothee Cour 2020-06-29 00:34:05 -07:00 • committed by GitHub
commit 1b41c3122b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 22 deletions

View file

@ -634,13 +634,14 @@ proc typeToString(typ: PType, prefer: TPreferedDesc = preferName): string =
if i < t.n.len - 1: result.add(", ")
result.add(']')
elif t.len == 0:
result = "tuple"
result = "tuple[]"
else:
if prefer == preferTypeName: result = "("
else: result = "tuple of ("
for i in 0..<t.len:
result.add(typeToString(t[i]))
if i < t.len - 1: result.add(", ")
elif t.len == 1: result.add(",")
result.add(')')
of tyPtr, tyRef, tyVar, tyLent:
result = typeToStr[t.kind]