scala/scala — pull request #554 by srp (2012-05-15 14:02:41+00:00)
Title: Enumeration#maxId: fix documentation to reflect reality

maxId is not really the "maximum id", but rather one past the max:

scala> object Foo extends Enumeration {
| val x = Value
| val y = Value
| }
defined module Foo

scala> Foo.maxId
res0: Int = 2

scala> Foo(2)
java.util.NoSuchElementException: key not found: 2
at scala.collection.MapLike$class.default(MapLike.scala:225)
...

scala> Foo(1)
res2: Foo.Value = y