Created
December 5, 2015 10:13
-
-
Save xevix/f888187a73cf4da0cc69 to your computer and use it in GitHub Desktop.
Slick asTry
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
// Dies with: | |
// | |
// Error:(151, 98) missing parameter type for expanded function | |
// The argument types of an anonymous function must be fully known. (SLS 8.5) | |
// Expected type was: scala.util.Try[?] => ? | |
// coffees.length.result.flatMap(_ => DBIO.failed(new Exception())).transactionally.asTry.map { | |
// ^ | |
coffees.length.result.flatMap(_ => DBIO.failed(new Exception())).transactionally.asTry.map { | |
case Failure(e: Throwable) => "failed" | |
case Success(_) => "succeeded" | |
} | |
// Splitting apart compiles | |
val foo = coffees.length.result.flatMap(_ => DBIO.failed(new Exception())).transactionally | |
foo.asTry.map { | |
case Failure(e: Throwable) => "failed" | |
case Success(_) => "succeeded" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment