diff options
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/t7285.check | 13 | ||||
-rw-r--r-- | test/files/neg/t7285.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t7285.scala | 55 |
3 files changed, 69 insertions, 0 deletions
diff --git a/test/files/neg/t7285.check b/test/files/neg/t7285.check new file mode 100644 index 0000000000..108f4292a8 --- /dev/null +++ b/test/files/neg/t7285.check @@ -0,0 +1,13 @@ +t7285.scala:15: error: match may not be exhaustive. +It would fail on the following input: (Up, Down) + (d1, d2) match { + ^ +t7285.scala:33: error: match may not be exhaustive. +It would fail on the following input: Down + (d1) match { + ^ +t7285.scala:51: error: match may not be exhaustive. +It would fail on the following input: (Up, Down) + (d1, d2) match { + ^ +three errors found diff --git a/test/files/neg/t7285.flags b/test/files/neg/t7285.flags new file mode 100644 index 0000000000..e8fb65d50c --- /dev/null +++ b/test/files/neg/t7285.flags @@ -0,0 +1 @@ +-Xfatal-warnings
\ No newline at end of file diff --git a/test/files/neg/t7285.scala b/test/files/neg/t7285.scala new file mode 100644 index 0000000000..14121d92b1 --- /dev/null +++ b/test/files/neg/t7285.scala @@ -0,0 +1,55 @@ +sealed abstract class Base + + +object Test1 { + sealed abstract class Base + + object Base { + case object Down extends Base { + } + + case object Up extends Base { + } + + (d1: Base, d2: Base) => + (d1, d2) match { + case (Up, Up) | (Down, Down) => false + case (Down, Up) => true + } + } +} + +object Test2 { + sealed abstract class Base + + object Base { + case object Down extends Base { + } + + case object Up extends Base { + } + + (d1: Base, d2: Base) => + (d1) match { + case Test2.Base.Up => false + } + } +} + + +object Test4 { + sealed abstract class Base + + object Base { + case object Down extends Base + + case object Up extends Base + } + + import Test4.Base._ + (d1: Base, d2: Base) => + (d1, d2) match { + case (Up, Up) | (Down, Down) => false + case (Down, Test4.Base.Up) => true + } +} |