diff options
author | Paul Phillips <paulp@improving.org> | 2009-04-23 20:22:04 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-04-23 20:22:04 +0000 |
commit | d1cd9999f24c4c0adde389f62c5eaa4876bbea55 (patch) | |
tree | 6fdb6d8a6ebe97a035165722b0a1cba2d9c3374b /test | |
parent | aaf919859f5dfa295aac8846bc109ceb87984a7e (diff) | |
download | scala-d1cd9999f24c4c0adde389f62c5eaa4876bbea55.tar.gz scala-d1cd9999f24c4c0adde389f62c5eaa4876bbea55.tar.bz2 scala-d1cd9999f24c4c0adde389f62c5eaa4876bbea55.zip |
Restructured Enumeration to have many fewer pub...
Restructured Enumeration to have many fewer public members so people
can import TheirEnum._ with less trepidation. The HOFs formerly in
Enumeration were removed, but as they all merely forwarded to elements
anyway, do this:
object Foo extends Enumeration { val FOO, BAR = Value }
import Foo._
Foo.elements filter (_ == FOO)
Diffstat (limited to 'test')
-rw-r--r-- | test/files/run/enums.scala | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/files/run/enums.scala b/test/files/run/enums.scala index 1fd7dfb6c4..48571ee010 100644 --- a/test/files/run/enums.scala +++ b/test/files/run/enums.scala @@ -13,7 +13,7 @@ object Test1 { ! (d == WeekDays.Sat || d == WeekDays.Sun); def run: Int = { - val it = WeekDays filter (isWorkingDay); + val it = WeekDays.elements filter (isWorkingDay); it.toList.length } } @@ -30,7 +30,7 @@ object Test2 { } def run: Int = { - val it = for (val s <- ThreadState; s.id != 0) yield s; + val it = for (val s <- ThreadState.elements; s.id != 0) yield s; it.toList.length } } @@ -42,7 +42,7 @@ object Test3 { } def run: Int = { - val it = for (val d <- Direction; d.toString() startsWith "N") yield d; + val it = for (val d <- Direction.elements; d.toString() startsWith "N") yield d; it.toList.length } } |