File: Main.hx

package info (click to toggle)
haxe 1%3A4.3.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 44,520 kB
  • sloc: ml: 137,268; ansic: 2,491; makefile: 456; java: 386; cs: 336; cpp: 318; python: 318; sh: 75; objc: 64; php: 50; xml: 31; javascript: 11
file content (70 lines) | stat: -rw-r--r-- 978 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
enum Tree<T> {
	Leaf(t:T);
	Node(l:Tree<T>, r:Tree<T>);
}

class Main {
	static function main() {

	}

	function testRedundance() {
		switch(true) {
			case false:
			case true:
			case false: // unused
		}

		switch(true) {
			case false | true:
			case true: // unused
			case false: // unused
		}

		switch(true) {
			case false
			| false: // unused
			case true:
		}

		switch(Leaf("foo")) {
			case Leaf(_)
				| Leaf("foo"): // unused
			case Node(l,r):
		}

		switch({s:"foo"}) {
			case { s : "foo" } :
			case { s : a } :
		}

		switch( { s:"foo", t:"bar" } ) {
			case { s : "foo" }:
			case { t : "bar" }:
			case { s : "foo", t:"bar" }: // unused
			case _:
		}

		switch ("foo") {
			case "foo":
			case x = "foo": // unused
		}

		switch ("foo") {
			case x = "foo":
			case "foo": // unused
		}

		switch [true] {
			case [true]:
			case [true]: // unused
			case [false]:
		}

		switch [true] {
			case [true]
			   | [true]: // unused
			case [false]:
		}
	}
}