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
Promise and Future could have a better toString #9488
Comments
Imported From: https://issues.scala-lang.org/browse/SI-9488?orig=1 |
@retronym said: |
Viktor Klang (viktorklang) said: However, I think the solution in 2.12.x is a bit dodgy in the sense that toString now has a temporal aspect to it, but perhaps that is not a problem since the same thing affects virtually every mutable object since the dawn of time. |
@SethTisue said: I suggest we backport the 2.12 fix for 2.11.9. |
@SethTisue said:
|
Viktor Klang (viktorklang) said: The old version is problematic, not only does it expose that a Future is also a Promise, but it also involved System.identityHashCode, which is not only problematic from the fact that it needs to be stored in the object header, but also because it conveys 0 meaning. Thoughts? |
@lrytz said: |
I noticed that in 2.12.x,
DefaultPromise
has inherited thetoString
of the its new parent,AtomicReference
.This unnecessarily leaks implementation details.
I think "" would be better. We might want to include the completion status, too.
Future
could take the same treatment.The text was updated successfully, but these errors were encountered: