summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-08-09 13:30:54 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-08-09 14:30:15 +0200
commit9108b2506c543587c92b10c83fcb650fcda425eb (patch)
tree86a43d037da830e962bcab40c7a00ded229a1d0c /test
parente232a614dd5402f59fb5bcb6031defe47e7e13f3 (diff)
downloadscala-9108b2506c543587c92b10c83fcb650fcda425eb.tar.gz
scala-9108b2506c543587c92b10c83fcb650fcda425eb.tar.bz2
scala-9108b2506c543587c92b10c83fcb650fcda425eb.zip
SI-6022 cleaner model of variable equality modulo <:
a more conservative "excludes": no need to reason about types (TODO: check we don't get any spurious unreachability errors in the eclipse build, which is a good canary for this kind of thing)
Diffstat (limited to 'test')
-rw-r--r--test/files/pos/t6022b.scala20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/files/pos/t6022b.scala b/test/files/pos/t6022b.scala
new file mode 100644
index 0000000000..6ceb928162
--- /dev/null
+++ b/test/files/pos/t6022b.scala
@@ -0,0 +1,20 @@
+trait A
+trait B
+trait C
+trait AB extends B with A
+
+// two types are mutually exclusive if there is no equality symbol whose constant implies both
+object Test extends App {
+ def foo(x: Any) = x match {
+ case _ : C => println("C")
+ case _ : AB => println("AB")
+ case _ : (A with B) => println("AB'")
+ case _ : B => println("B")
+ case _ : A => println("A")
+ }
+
+ foo(new A {})
+ foo(new B {})
+ foo(new AB{})
+ foo(new C {})
+}