summaryrefslogtreecommitdiff
path: root/test/files/run/t5688.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t5688.scala')
-rw-r--r--test/files/run/t5688.scala23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/files/run/t5688.scala b/test/files/run/t5688.scala
new file mode 100644
index 0000000000..f99bfb47d3
--- /dev/null
+++ b/test/files/run/t5688.scala
@@ -0,0 +1,23 @@
+object Test extends App {
+ trait T
+
+ trait TA
+ trait TB
+
+ class A extends T with TA
+ class B extends T with TB
+ class AB extends T with TA with TB
+ // Matching on _: TA with TB
+
+ val li: Vector[T] = Vector(new A, new B, new AB)
+
+ val matched = (for (l <- li) yield {
+ l match {
+ case _: TA with TB => "tab"
+ case _: TA => "ta"
+ case _: TB => "tb"
+ }
+ })
+
+ println(matched)
+} \ No newline at end of file