summaryrefslogtreecommitdiff
path: root/test/files/run/t9110.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/t9110.scala')
-rw-r--r--test/files/run/t9110.scala27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/files/run/t9110.scala b/test/files/run/t9110.scala
new file mode 100644
index 0000000000..660291a4d1
--- /dev/null
+++ b/test/files/run/t9110.scala
@@ -0,0 +1,27 @@
+trait Event
+
+trait Domain {
+ case class Created(name: String) extends Event
+}
+
+// declare three instances of Domain trait, one here and two
+// in an inner scope
+
+object DomainC extends Domain
+
+object Test {
+ def main(args: Array[String]) {
+ object DomainA extends Domain
+ object DomainB extends Domain
+
+ def lookingForAs(event: Event): Unit = {
+ event match {
+ case DomainB.Created(_) => throw null
+ case DomainC.Created(_) => throw null
+ case DomainA.Created(_) => // okay
+ }
+ }
+
+ lookingForAs(DomainA.Created("I am an A"))
+ }
+}