diff options
author | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-13 14:20:06 -0700 |
---|---|---|
committer | Josh Suereth <Joshua.Suereth@gmail.com> | 2012-08-13 14:20:06 -0700 |
commit | d1bdafa6bad6bb8b240d0ede8d711c1f00ab3829 (patch) | |
tree | fd7d427ca77cb94e7785da8a68b24030ddf7cc81 /test/files/pos | |
parent | 96afad8e9ae3872bd9f787f1b1da4dea56b10682 (diff) | |
parent | 9108b2506c543587c92b10c83fcb650fcda425eb (diff) | |
download | scala-d1bdafa6bad6bb8b240d0ede8d711c1f00ab3829.tar.gz scala-d1bdafa6bad6bb8b240d0ede8d711c1f00ab3829.tar.bz2 scala-d1bdafa6bad6bb8b240d0ede8d711c1f00ab3829.zip |
Merge pull request #1100 from adriaanm/ticket-6022b
SI-6022 cleaner model of variable equality modulo <:
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t6022b.scala | 20 |
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 {}) +} |