Enumeration.values adds a value to set when called twice?
scala> object Foo extends Enumeration {
| val B开发者_JS百科ar = Value(23)
| val Moo = Value(57)
| }
defined module Foo
scala> Foo.values
res27: Foo.ValueSet = Foo.ValueSet(Bar, Moo)
So far as expected. But then (continuing from above):
scala> Foo.values
res28: Foo.ValueSet = Foo.ValueSet(Bar, Moo, Value)
What just happened?
This is a bug in Scala 2.8.1. See the issue on JIRA.
精彩评论