From 6fcd8a6d059c574bd18afe73bcb11812bfba3dd3 Mon Sep 17 00:00:00 2001 From: Janek Bogucki Date: Wed, 5 Aug 2015 13:05:18 +0100 Subject: Stop mapping to Unit when executing finally code. Finally.invoke has result type Unit so foreach is sufficient here. --- src/library/scala/util/control/Exception.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/library/scala/util/control/Exception.scala b/src/library/scala/util/control/Exception.scala index aa30887ba0..24c297a2fc 100644 --- a/src/library/scala/util/control/Exception.scala +++ b/src/library/scala/util/control/Exception.scala @@ -105,7 +105,7 @@ object Exception { case x if rethrow(x) => throw x case x if pf isDefinedAt x => pf(x) } - finally fin map (_.invoke()) + finally fin foreach (_.invoke()) /* Create an empty Try container with this Catch and the supplied `Finally`. */ def andFinally(body: => Unit): Catch[T] = fin match { -- cgit v1.2.3