-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Add scala.Try
as alias of scala.util.Try
to scala
package.
#7425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
But maybe the |
@hepin1989 I agree that package object scala {
...
type Try[+A] = scala.util.Try[A]
val Try = scala.util.Try
type Success[+A] = scala.util.Success[A]
val Success = scala.util.Success
type Failure[+A] = scala.util.Failure[A]
val Failure = scala.util.Failure
...
} Such approach at least won't break source compatibility |
@vitaliihonta once moved we could do some extraction of the |
scala.util.Try
and scala.util.Either
to scala
package.scala.util.Try
and scala.util.Either
to scala
package.
Had a quick chat about this with @adriaanm. We suggest the following for 2.13 (as it's very late in the game):
|
@lrytz I will address your comment tonight. |
@lrytz Should we take the same lockstep, eg move |
@@ -143,4 +143,6 @@ package object scala { | |||
type Right[+A, +B] = scala.util.Right[A, B] | |||
val Right = scala.util.Right | |||
|
|||
type Try[+T] = scala.util.Try[T] | |||
val Try = scala.util.Try |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as requested.
test/files/neg/logImplicits.check
Outdated
def f = (1 -> 2) + "c" | ||
^ | ||
logImplicits.scala:21: applied implicit conversion from (Int, Int) to ?{def +: ?} = final implicit def any2stringadd[A](self: A): any2stringadd[A] | ||
logImplicits.scala:21: applied implicit conversion from (Int, Int) to ?{def +: ?} = implicit def any2stringadd[A](self: A): any2stringadd[A] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, seems it's my problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apparently you fixed something and the final flag is no longer needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Kobenko thanks, seems like I switched between branches and it was messed up.
scala.util.Try
and scala.util.Either
to scala
package.scala.Try
as alias of scala.util.Try
to scala
package.
1. Move `Success` and `Failure` inside the `Try`'s companion object, 2.Add alias for to `scala.util`'s package object and deprecated them in favor of `Scala.Try`, `Try.Success` and `Try.Failure`.
/** | ||
* Class `Failure[+T]` represent a computation of `T` is failed with a [[Throwable]]. | ||
* | ||
* @tparam T Type of the expected result value type. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked it with my local build.
Looks good to me now. Maybe it's better to start a new pull request, so we can start a fresh discussion. |
ok |
pre: #7549 |
These classes deserve to be top level. And could help if we want to move some classes in
scala.util
to dedicated modules.One concern is serialization stability....
refs:scala/bug#11268