summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-07-02 07:19:43 -0700
committerGitHub <noreply@github.com>2020-07-02 16:19:43 +0200
commita6cbe58e8c5a9b89d749d9935ee39192de3246d9 (patch)
treee17a5ff00a5ced96996d20a561ce799077fa016a /tests
parentdc5a40f3f39c6ea672e6dc6aca7f8118a69dda99 (diff)
downloadNim-a6cbe58e8c5a9b89d749d9935ee39192de3246d9.tar.gz
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/errmsgs/tnested_empty_seq.nim2
-rw-r--r--tests/errmsgs/tsigmatch.nim6
-rw-r--r--tests/metatype/ttypetraits.nim6
-rw-r--r--tests/template/tgensym_instantiationinfo.nim2
4 files changed, 7 insertions, 9 deletions
diff --git a/tests/errmsgs/tnested_empty_seq.nim b/tests/errmsgs/tnested_empty_seq.nim
index ffe8bc3ee..871b0ee85 100644
--- a/tests/errmsgs/tnested_empty_seq.nim
+++ b/tests/errmsgs/tnested_empty_seq.nim
@@ -1,5 +1,5 @@
 discard """
-  errormsg: "invalid type: 'empty' in this context: 'array[0..0, tuple of (string, seq[empty])]' for var"
+  errormsg: "invalid type: 'empty' in this context: 'array[0..0, (string, seq[empty])]' for var"
   line: 8
 """
 
diff --git a/tests/errmsgs/tsigmatch.nim b/tests/errmsgs/tsigmatch.nim
index 414c972c9..4f40be2d4 100644
--- a/tests/errmsgs/tsigmatch.nim
+++ b/tests/errmsgs/tsigmatch.nim
@@ -12,12 +12,12 @@ proc f(b: B)
   but expression 'A()' is of type: A
 
 expression: f(A(), "extra")
-tsigmatch.nim(125, 6) Error: type mismatch: got <tuple of (string, proc (){.gcsafe, locks: 0.})>
+tsigmatch.nim(125, 6) Error: type mismatch: got <(string, proc (){.gcsafe, locks: 0.})>
 but expected one of:
 proc foo(x: (string, proc ()))
   first type mismatch at position: 1
-  required type for x: tuple of (string, proc (){.closure.})
-  but expression '("foobar", proc () = echo(["Hello!"]))' is of type: tuple of (string, proc (){.gcsafe, locks: 0.})
+  required type for x: (string, proc (){.closure.})
+  but expression '("foobar", proc () = echo(["Hello!"]))' is of type: (string, proc (){.gcsafe, locks: 0.})
 
 expression: foo(("foobar", proc () = echo(["Hello!"])))
 tsigmatch.nim(132, 11) Error: type mismatch: got <proc (s: string): string{.noSideEffect, gcsafe, locks: 0.}>
diff --git a/tests/metatype/ttypetraits.nim b/tests/metatype/ttypetraits.nim
index ca918266f..50c474fe9 100644
--- a/tests/metatype/ttypetraits.nim
+++ b/tests/metatype/ttypetraits.nim
@@ -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
diff --git a/tests/template/tgensym_instantiationinfo.nim b/tests/template/tgensym_instantiationinfo.nim
index 305e7e1c3..4b997ed6a 100644
--- a/tests/template/tgensym_instantiationinfo.nim
+++ b/tests/template/tgensym_instantiationinfo.nim
@@ -5,7 +5,7 @@ discard """
 # bug #7937
 
 template printError(error: typed) =
-  # Error: inconsistent typing for reintroduced symbol 'instInfo': previous type was: tuple[filename: string, line: int, column: int]; new type is: tuple of (string, int, int)
+  # Error: inconsistent typing for reintroduced symbol 'instInfo': previous type was: tuple[filename: string, line: int, column: int]; new type is: (string, int, int)
   let instInfo {.gensym.} = instantiationInfo()
   echo "Error at ", instInfo.filename, ':', instInfo.line, ": ", error