Created
November 30, 2013 06:52
-
-
Save vega113/7716156 to your computer and use it in GitHub Desktop.
Extend existing companion object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implicit class FutureCompanionOps(f: Future.type) extends AnyVal { | |
def userInput(message: String): Future[String] = Future { | |
readLine(message) | |
} | |
} | |
class FutureCompanionOps(f: Future.type) extends AnyVal { | |
def userInput(message: String): Future[String] = Future { | |
readLine(message) | |
} | |
} | |
implicit def f2ops(f: Future.type) = new FutureCompanionOps(f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment