aboutsummaryrefslogtreecommitdiff
path: root/tests/patmat/aladdin1055
diff options
context:
space:
mode:
authorliu fengyun <liufengyunchina@gmail.com>2016-07-21 10:45:14 +0200
committerliu fengyun <liufengyunchina@gmail.com>2016-08-24 10:26:59 +0200
commitcc02243fbe8b7290265e1bdf540e4c2f256df199 (patch)
treebd83dcabb8de09fa48b9373b9431ef8c481da5ed /tests/patmat/aladdin1055
parent1a7618f32c6d8060c3a87ce633645440d500aa7a (diff)
downloaddotty-cc02243fbe8b7290265e1bdf540e4c2f256df199.tar.gz
dotty-cc02243fbe8b7290265e1bdf540e4c2f256df199.tar.bz2
dotty-cc02243fbe8b7290265e1bdf540e4c2f256df199.zip
add test set for exhaustivity and redundancy check
Diffstat (limited to 'tests/patmat/aladdin1055')
-rw-r--r--tests/patmat/aladdin1055/A.scala6
-rw-r--r--tests/patmat/aladdin1055/Test_1.scala.ignore5
-rw-r--r--tests/patmat/aladdin1055/expected.check.ignore5
3 files changed, 16 insertions, 0 deletions
diff --git a/tests/patmat/aladdin1055/A.scala b/tests/patmat/aladdin1055/A.scala
new file mode 100644
index 000000000..862336e30
--- /dev/null
+++ b/tests/patmat/aladdin1055/A.scala
@@ -0,0 +1,6 @@
+object A {
+ sealed trait T { def f: Int }
+ class TT extends T { def f = 0 }
+
+ def foo = new T { def f = 1 } // local subclass of sealed trait T
+}
diff --git a/tests/patmat/aladdin1055/Test_1.scala.ignore b/tests/patmat/aladdin1055/Test_1.scala.ignore
new file mode 100644
index 000000000..39d9b1dc9
--- /dev/null
+++ b/tests/patmat/aladdin1055/Test_1.scala.ignore
@@ -0,0 +1,5 @@
+object Test {
+ def foo(t: A.T) = t match {
+ case a: A.TT => 0
+ }
+}
diff --git a/tests/patmat/aladdin1055/expected.check.ignore b/tests/patmat/aladdin1055/expected.check.ignore
new file mode 100644
index 000000000..a8024ad02
--- /dev/null
+++ b/tests/patmat/aladdin1055/expected.check.ignore
@@ -0,0 +1,5 @@
+./tests/patmat/aladdin1055/Test_1.scala:2: warning: match may not be exhaustive.
+It would fail on the following input: (_ : this.<local child>)
+ def foo(t: A.T) = t match {
+ ^
+one warning found