summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/collection/Map.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/library/scala/collection/Map.scala b/src/library/scala/collection/Map.scala
index 14546e9e71..8a20f10255 100644
--- a/src/library/scala/collection/Map.scala
+++ b/src/library/scala/collection/Map.scala
@@ -53,7 +53,7 @@ trait Map[A, +B] extends AnyRef with PartialFunction[A, B] with Iterable[Pair[A,
* @return the value associated with the given key.
*/
def apply(key: A): B = get(key) match {
- case None => default
+ case None => default(key)
case Some(value) => value
}
@@ -174,7 +174,7 @@ trait Map[A, +B] extends AnyRef with PartialFunction[A, B] with Iterable[Pair[A,
* The method implemented here yields an error,
* but it might be overridden in subclasses.
*/
- def default: B =
- error("key not found")
+ def default(key: A): B =
+ error("key not found: " + key)
}