8000 SI-9488 - adds the same default toString format to Scala Futures as 2… by viktorklang · Pull Request #5056 · scala/scala · GitHub
[go: up one dir, main page]

Skip to content

SI-9488 - adds the same default toString format to Scala Futures as 2… #5056

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

Merged
merged 1 commit into from
Mar 23, 2016
Merged

SI-9488 - adds the same default toString format to Scala Futures as 2… #5056

merged 1 commit into from
Mar 23, 2016

Conversation

viktorklang
Copy link
Contributor

….12.x

Includes tests to verify the toString representations.

@scala-jenkins scala-jenkins added this to the 2.11.9 milestone Mar 22, 2016
….12.x

Includes tests to verify the toString representations.
@viktorklang
Copy link 8000
Contributor Author

@retronym Could you have a look? (https://issues.scala-lang.org/browse/SI-9488)

@retronym
Copy link
Member

LGTM

Thanks!

@retronym
Copy link
Member

/rebuild

@lrytz
Copy link
Member
lrytz commented Mar 23, 2016

IDE failure due to scala/scala-dev#104

@lrytz lrytz merged commit 4ef1429 into scala:2.11.x Mar 23, 2016
@viktorklang
Copy link
Contributor Author

Thanks Lukas!

@lrytz
Copy link
Member
lrytz commented Mar 23, 2016

btw, since i went trough the exercise of understanding the binary compatibility impact, here's why i think it's safe. adding a concrete method to a trait requires re-compiling all sublcasses, here's an what happens otherwise:

➜ cat A.scala
trait A {
  override def toString = "hjai"
}
➜ cat B.scala
class C extends A
object Test extends App {
  println((new C).toString)
}
➜ scalac A.scala B.scala
➜ scala Test
hjai
➜ rm A*.class
➜ cat A1.scala
trait A {
  //override def toString = "hjai"
}
➜ scalac A1.scala
➜ scala Test
java.lang.ClassNotFoundException: A$class
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

trait Promise[T] is private[concurrent] and its subtypes are

  • either also private (and being recompiled as part of the same codebase)
  • class DefaultPromise is a class, so the mix-in is generated

so it looks safe.

@viktorklang
Copy link
Contributor Author

@lrytz yes, exactly. That's why I put the code in that trait and not the Future-trait itself :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0