summary refs log tree commit diff stats
path: root/tests/sets
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2021-11-03 01:46:34 -0400
committerGitHub <noreply@github.com>2021-11-03 06:46:34 +0100
commit539bced70df035ddbdbf4c3d9c7fd6074f0b1073 (patch)
tree33f75baaf6bedf82eca57a8eaf5f2b3482c0295b /tests/sets
parentb155864967ba08861c39403003095d4822b03b4e (diff)
downloadNim-539bced70df035ddbdbf4c3d9c7fd6074f0b1073.tar.gz
Add test for issue 15435 (#19079)
* Add test for issue 15435

Closes https://github.com/nim-lang/Nim/issues/15435.

* Specify bug # in comment

Addresses https://github.com/nim-lang/Nim/pull/19079#discussion_r740279547
Diffstat (limited to 'tests/sets')
-rw-r--r--tests/sets/t15435.nim29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/sets/t15435.nim b/tests/sets/t15435.nim
new file mode 100644
index 000000000..5ead7e641
--- /dev/null
+++ b/tests/sets/t15435.nim
@@ -0,0 +1,29 @@
+# bug #15435
+discard """
+errormsg: "type mismatch: got <set[uint8], set[range 1..5(uint8)]>"
+nimout: '''t15435.nim(28, 13) Error: type mismatch: got <set[uint8], set[range 1..5(uint8)]>
+but expected one of:
+proc `<`[T](x, y: set[T]): bool
+  first type mismatch at position: 2
+  required type for y: set[T]
+  but expression 'x' is of type: set[range 1..5(uint8)]
+20 other mismatching symbols have been suppressed; compile with --showAllMismatches:on to see them
+
+expression: {1'u8, 5} < x'''
+"""
+
+
+
+
+
+
+## line 20
+var
+  x: set[range[1u8..5u8]]
+
+x.incl(1)
+x.incl(3)
+x.incl(5)
+
+if {1u8, 5} < x:
+  echo "successful"