Skip to content

Commit

Permalink
Add test for issue 15435
Browse files Browse the repository at this point in the history
Closes #15435.
  • Loading branch information
kaushalmodi committed Nov 1, 2021
1 parent 2f730af commit c38da3b
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions tests/sets/t15435.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
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"

discard {1u8, 3, 5} + x

0 comments on commit c38da3b

Please sign in to comment.