1export fn entry1(x: u8) void {
2 switch (x) {
3 1...2 => {},
4 0...255 => {},
5 }
6}
7
8export fn entry2(x: i8) void {
9 switch (x) {
10 -128...5 => {},
11 5...127 => {},
12 }
13}
14
15export fn entry3(x: u8) void {
16 switch (x) {
17 0...5 => {},
18 5 => {},
19 6...255 => {},
20 }
21}
22
23export fn entry4(x: u8) void {
24 switch (x) {
25 0...5 => {},
26 6 => {},
27 6...255 => {},
28 }
29}
30
31export fn entry5(x: u8) void {
32 switch (x) {
33 0...255 => {},
34 4...120 => {},
35 }
36}
37
38export fn entry6(x: u8) void {
39 switch (x) {
40 0...130 => {},
41 120...255 => {},
42 }
43}
44
45export fn entry7(x: u8) void {
46 switch (x) {
47 2 => {},
48 0...255 => {},
49 }
50}
51
52// error
53//
54// :4:10: error: duplicate switch ranges
55// :3:10: note: overlaps with previous range here
56// :3:10: note: ranges overlap from '1' to '2'
57// :11:10: error: duplicate switch value '5'
58// :10:13: note: previous value inside range here
59// :17:10: error: duplicate switch value '5'
60// :18:9: note: previous value here
61// :27:10: error: duplicate switch value '6'
62// :26:9: note: previous value here
63// :34:10: error: duplicate switch ranges
64// :33:10: note: overlaps with previous range here
65// :33:10: note: ranges overlap from '4' to '120'
66// :41:12: error: duplicate switch ranges
67// :40:10: note: overlaps with previous range here
68// :40:10: note: ranges overlap from '120' to '130'
69// :48:10: error: duplicate switch value '2'
70// :47:9: note: previous value here