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
Array.toString prints object id #3711
Comments
Imported From: https://issues.scala-lang.org/browse/SI-3711?orig=1 |
@retronym said: The pretty output on the first line is a nicety of the REPL, but can only work in an expression evaluates to Array. See: http://stackoverflow.com/questions/2481149/why-does-array0-1-2-array0-1-2-not-return-the-expected-result And probably more I missed. |
Eugene (euee) said: C:\opt\scala-2.7.7.final\bin>scala.bat scala> Array(1,2) scala> println(res0.toString()) scala> |
@paulp said:
Only if someone was depending on the output of toString. Rather unwise. In any case, 2.7 is much worse from a consistency standpoint. Extending your example a little: Welcome to Scala version 2.7.7.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_20).
Type in expressions to have them evaluated.
Type :help for more information.
scala> Array(1,2)
res0: Array[Int] = Array(1, 2)
scala> println(res0.toString())
Array(1, 2)
scala> println(res0)
[I@36d98810
scala> |
The text was updated successfully, but these errors were encountered: