typetraits.$: $((int, float), int) is now "((int, float), int)" instead of "(tuple of (int, float), int)" (#14812)

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Timothee Cour 2020-07-02 07:19:43 -07:00 • committed by GitHub
commit a6cbe58e8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 12 deletions

View file

@ -52,10 +52,8 @@ block: # name, `$`
doAssert $tuple[] == "tuple[]"
doAssert $(int,) == "(int,)"
doAssert $(int, float) == "(int, float)"
doAssert $((int), tuple[], tuple[a: uint], tuple[a: uint, b: float], (int,), (int, float)) == "(int, tuple[], tuple[a: uint], tuple[a: uint, b: float], tuple of (int,), tuple of (int, float))"
# xxx this is inconsistent, it should be:
# "(int, tuple[], tuple[a: uint], tuple[a: uint, b: float], (int,), (int, float))"
# which matches how you write it, is consistent with `$(int,)`, and is un-ambiguous.
doAssert $((int), tuple[], tuple[a: uint], tuple[a: uint, b: float], (int,), (int, float)) ==
"(int, tuple[], tuple[a: uint], tuple[a: uint, b: float], (int,), (int, float))"
block: # typeToString
type MyInt = int