diff options
author | liu fengyun <liu@fengy.me> | 2017-04-06 15:36:37 +0200 |
---|---|---|
committer | liu fengyun <liu@fengy.me> | 2017-04-06 15:38:04 +0200 |
commit | 0c4a06f8409feac5ba99c0a8961210225dbd4936 (patch) | |
tree | 9fb1b7e5d0bb52baaf9b771e5f1e4071dc47e708 /tests/patmat | |
parent | 52521ea6070d907f77ceab0692f804f52c29ffca (diff) | |
download | dotty-0c4a06f8409feac5ba99c0a8961210225dbd4936.tar.gz dotty-0c4a06f8409feac5ba99c0a8961210225dbd4936.tar.bz2 dotty-0c4a06f8409feac5ba99c0a8961210225dbd4936.zip |
exhaustivity support for enums
Diffstat (limited to 'tests/patmat')
-rw-r--r-- | tests/patmat/enumColor.scala | 12 | ||||
-rw-r--r-- | tests/patmat/patmat-indent.check | 2 | ||||
-rw-r--r-- | tests/patmat/patmat-indent.scala | 2 | ||||
-rw-r--r-- | tests/patmat/t6420.check | 2 | ||||
-rw-r--r-- | tests/patmat/t7285.check | 2 | ||||
-rw-r--r-- | tests/patmat/t7466.check | 2 |
6 files changed, 17 insertions, 5 deletions
diff --git a/tests/patmat/enumColor.scala b/tests/patmat/enumColor.scala new file mode 100644 index 000000000..60d610d0d --- /dev/null +++ b/tests/patmat/enumColor.scala @@ -0,0 +1,12 @@ + enum Color { + case Red, Green, Blue + } + + object Test { + def f(color: Color) = { + import Color._ + color match { + case Red | Green | Blue => + } + } +} diff --git a/tests/patmat/patmat-indent.check b/tests/patmat/patmat-indent.check index 79845ebcf..4f0ec4dd9 100644 --- a/tests/patmat/patmat-indent.check +++ b/tests/patmat/patmat-indent.check @@ -1,3 +1,3 @@ 9: Pattern Match Exhaustivity: Nil -23: Pattern Match Exhaustivity: _: Boolean +23: Pattern Match Exhaustivity: true, false 27: Pattern Match Exhaustivity: _: Int diff --git a/tests/patmat/patmat-indent.scala b/tests/patmat/patmat-indent.scala index ef25bb2c7..a2b18e7fb 100644 --- a/tests/patmat/patmat-indent.scala +++ b/tests/patmat/patmat-indent.scala @@ -1,5 +1,5 @@ object Test { - val Nil = scala.Nil + val Nil: scala.collection.immutable.Nil.type = scala.collection.immutable.Nil val X = 5 object Inner { diff --git a/tests/patmat/t6420.check b/tests/patmat/t6420.check index 73acf1454..c15701594 100644 --- a/tests/patmat/t6420.check +++ b/tests/patmat/t6420.check @@ -1 +1 @@ -5: Pattern Match Exhaustivity: (Nil, _), (List(_, _), _), (Nil, Nil), (Nil, List(_, _)), (List(_, _), Nil), (List(_, _), List(_, _)), (_, Nil), (_, List(_, _)) +5: Pattern Match Exhaustivity: (Nil, _), (List(true, _), _), (List(false, _), _), (_, Nil), (_, List(true, _)), (_, List(false, _)) diff --git a/tests/patmat/t7285.check b/tests/patmat/t7285.check index 1c2841920..d40b77e4b 100644 --- a/tests/patmat/t7285.check +++ b/tests/patmat/t7285.check @@ -1,3 +1,3 @@ 15: Pattern Match Exhaustivity: (Up, Down) 33: Pattern Match Exhaustivity: Down -51: Pattern Match Exhaustivity: (Base.Up, Base.Down) +51: Pattern Match Exhaustivity: (Up, Down) diff --git a/tests/patmat/t7466.check b/tests/patmat/t7466.check index 35227484e..af596399b 100644 --- a/tests/patmat/t7466.check +++ b/tests/patmat/t7466.check @@ -1 +1 @@ -8: Pattern Match Exhaustivity: (_, _) +8: Pattern Match Exhaustivity: (true, _), (false, _), (_, true), (_, false) |