We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Minor issue that dotty REPL shows "hex representation of hashcode" of the array instead of showing elements in it.
scala> val data = Array(1, 3, 5, 7, 11).map(x => x * x) val data: Array[Int] = [I@6eda012b scala> data.toString val res11: String = "[I@6eda012b"
while "scalac REPL" shows the elements which I think is expected in REPL.
scala> val data = Array(1, 3, 5, 7, 11).map(x => x * x) data: Array[Int] = Array(1, 9, 25, 49, 121) scala> data.toString res11: String = [I@3071d086
Seq works fine in dotty REPL.
Seq
scala> Seq(1, 3, 5, 7, 11).map(x => x * x) val res12: Seq[Int] = List(1, 9, 25, 49, 121)
Solution probably is to use java.lang.Arrays.toString or different toString.
java.lang.Arrays.toString
scala> java.util.Arrays.toString(Array(1, 3, 5, 7, 11)) val res19: String = "[1, 3, 5, 7, 11]"
environment
$ dotc -version Dotty compiler version 0.6.0-RC1 -- Copyright 2002-2018, LAMP/EPFL $ dotr -version java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
The text was updated successfully, but these errors were encountered:
A simple solution would be to add an implicit Show instance for Array in https://github.com/lampepfl/dotty/blob/master/library/src/dotty/Show.scala
Show
Array
Sorry, something went wrong.
I want to try this in the next few days.
Hi @jendrikw.
Sorry but I missed your update. I hope you did not start work on it yet. Cheers!
053810e
Merge pull request #4200 from bhop/feature/show-instance-for-arrays
ef4c430
Fix #4067 dotty REPL shows the Array hexcode instead of actual elements
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
Minor issue that dotty REPL shows "hex representation of hashcode" of the array instead of showing elements in it.
while "scalac REPL" shows the elements which I think is expected in REPL.
Seq
works fine in dotty REPL.Solution probably is to use
java.lang.Arrays.toString
or different toString.environment
$ dotc -version Dotty compiler version 0.6.0-RC1 -- Copyright 2002-2018, LAMP/EPFL $ dotr -version java version "1.8.0_151" Java(TM) SE Runtime Environment (build 1.8.0_151-b12) Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
The text was updated successfully, but these errors were encountered: