diff options
author | Paul Phillips <paulp@improving.org> | 2009-05-12 12:28:55 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-05-12 12:28:55 +0000 |
commit | 99e44f21fef0b75791b7b08387bdcdfc8f6dfb65 (patch) | |
tree | b4efc0ef096ad6f83d294a630d83bcb6a092a03d /src | |
parent | 11f5744d1f3370d5519e80f4814e273c5d82b5c1 (diff) | |
download | scala-99e44f21fef0b75791b7b08387bdcdfc8f6dfb65.tar.gz scala-99e44f21fef0b75791b7b08387bdcdfc8f6dfb65.tar.bz2 scala-99e44f21fef0b75791b7b08387bdcdfc8f6dfb65.zip |
Reverted probably unintentional change to Enume...
Reverted probably unintentional change to Enumeration (the method
formerly called valueOf and now called withName needs to return
Option[Value], not Value) and updated the failing tests to use the new
Enumeration interface.
Diffstat (limited to 'src')
-rw-r--r-- | src/library/scala/Enumeration.scala | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/library/scala/Enumeration.scala b/src/library/scala/Enumeration.scala index e752fcd523..3dfd9bb740 100644 --- a/src/library/scala/Enumeration.scala +++ b/src/library/scala/Enumeration.scala @@ -113,12 +113,12 @@ abstract class Enumeration(initial: Int, names: String*) { * the argument <var>s</var>. * You must pass a String* set of names to the constructor, * or initialize each Enumeration with Value(String), - * for valueOf to work. + * for withName to work. * @param s an enumeration name * @return <tt>Some(Value)</tt> if an enumeration's name matches <var>s</var>, * else <tt>None</tt> */ - def withName(s: String): Value = values.find(_.toString == s).get + def withName(s: String): Option[Value] = values.find(_.toString == s) /** Creates a fresh value, part of this enumeration. */ protected final def Value: Value = Value(nextId) |