Removing an unused implicit parameter from scala.concurrent.promise

107 views
Skip to first unread message

Jason Zaugg

unread,
Nov 14, 2012, 3:41:48 AM11/14/12
to scala...@googlegroups.com
Any objections to a last minute, innocuous change to this method. It asks for an implicit ExecutionContext, but doesn't need one. We won't be able to change it post 2.10.0.

-jason



From bad9c39e4eac614f2c3bafe176e70190bb14a75a Mon Sep 17 00:00:00 2001
From: phaller <hal...@gmail.com>
Date: Tue, 13 Nov 2012 17:45:11 +0100
Subject: [PATCH] Remove obsolete implicit parameter of
 scala.concurrent.promise method

---
 src/library/scala/concurrent/package.scala |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/library/scala/concurrent/package.scala b/src/library/scala/concurrent/package.scala
index f7c732b..3e849f1 100644
--- a/src/library/scala/concurrent/package.scala
+++ b/src/library/scala/concurrent/package.scala
@@ -29,13 +29,12 @@ package object concurrent {
    */
   def future[T](body: =>T)(implicit execctx: ExecutionContext): Future[T] = Future[T](body)
 
-  /** Creates a promise object which can be completed with a value.
+  /** Creates a promise object which can be completed with a value or an exception.
    *  
    *  @tparam T       the type of the value in the promise
-   *  @param execctx  the execution context on which the promise is created on
    *  @return         the newly created `Promise` object
    */
-  def promise[T]()(implicit execctx: ExecutionContext): Promise[T] = Promise[T]()
+  def promise[T](): Promise[T] = Promise[T]()
 
   /** Used to designate a piece of code which potentially blocks, allowing the current [[BlockContext]] to adjust
    *  the runtime's behavior.
-- 
1.7.10

Heather Miller

unread,
Nov 14, 2012, 3:50:12 AM11/14/12
to scala...@googlegroups.com
This is an inconsistency introduced after refactoring implicit ExecutionContexts. In this commit:
https://github.com/scala/scala/commit/1dfce90246f7d334e34d110afb8b1517180995fc#diff-1

...the implicit ExecutionContexts were removed from everything else in Promise.scala, but it appears that method `promise` was missed in the scala.concurrent package object, which would've made sense to remove back then.

So this looks like a welcome correction.

Cheers,
Heather

-- 
Heather Miller
Doctoral Assistant
EPFL, IC, LAMP

√iktor Ҡlang

unread,
Nov 14, 2012, 4:46:52 AM11/14/12
to <scala-sips@googlegroups.com>
Heather is right, +1 for me
--
Viktor Klang

Akka Tech Lead
Typesafe - The software stack for applications that scale

Twitter: @viktorklang

Eric Torreborre

unread,
Nov 14, 2012, 9:38:57 PM11/14/12
to scala...@googlegroups.com
Why is it necessary to keep the empty parens `()` on the method definition?
Reply all
Reply to author
Forward
0 new messages