diff options
author | metagn <metagngn@gmail.com> | 2023-05-02 12:13:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-02 11:13:38 +0200 |
commit | c2bcfd8cd908265c358c60c4da137783b10a8549 (patch) | |
tree | 55b4d8b1efae6e820c88f0118ce9c96e62451c7a /tests | |
parent | afc30ca87948c11f603f6686d4b10d3dcc27776a (diff) | |
download | Nim-c2bcfd8cd908265c358c60c4da137783b10a8549.tar.gz |
cheap fix for #10853 + better tuple subscript error message (#21767)
* cheap fix for #10853 * also better tuple subscript error message * weird
Diffstat (limited to 'tests')
-rw-r--r-- | tests/errmsgs/tassignunpack.nim | 3 | ||||
-rw-r--r-- | tests/errmsgs/ttupleindexoutofbounds.nim | 2 | ||||
-rw-r--r-- | tests/types/tassignemptytuple.nim | 2 |
3 files changed, 6 insertions, 1 deletions
diff --git a/tests/errmsgs/tassignunpack.nim b/tests/errmsgs/tassignunpack.nim new file mode 100644 index 000000000..27413a42b --- /dev/null +++ b/tests/errmsgs/tassignunpack.nim @@ -0,0 +1,3 @@ +var a, b = 0 +(a, b) = 1 #[tt.Error + ^ type mismatch: got <int literal(1)> but expected 'tuple']# diff --git a/tests/errmsgs/ttupleindexoutofbounds.nim b/tests/errmsgs/ttupleindexoutofbounds.nim new file mode 100644 index 000000000..ae634dddb --- /dev/null +++ b/tests/errmsgs/ttupleindexoutofbounds.nim @@ -0,0 +1,2 @@ +let a = (1, 2)[4] #[tt.Error + ^ invalid index 4 in subscript for tuple of length 2]# diff --git a/tests/types/tassignemptytuple.nim b/tests/types/tassignemptytuple.nim index 9d5a311ba..f3320dec7 100644 --- a/tests/types/tassignemptytuple.nim +++ b/tests/types/tassignemptytuple.nim @@ -1,5 +1,5 @@ discard """ - errormsg: "cannot infer the type of the tuple" + errormsg: "invalid type: 'empty' in this context: '(seq[empty], (seq[empty], set[empty]))' for let" file: "tassignemptytuple.nim" line: 11 """ |