You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
scala>Array.fill(1)(Array(()))
java.lang.IllegalArgumentException
at java.lang.reflect.Array.newArray(NativeMethod)
at java.lang.reflect.Array.newInstance(Array.java:52)
at scala.reflect.ClassManifest$class.arrayClass(ClassManifest.scala:107)
at scala.reflect.Manifest$$anon$9.arrayClass(Manifest.scala:152)
at scala.reflect.Manifest$class.arrayManifest(Manifest.scala:46)
at scala.reflect.Manifest$$anon$9.arrayManifest(Manifest.scala:152)
at scala.reflect.Manifest$$anon$9.arrayManifest(Manifest.scala:152)
at scala.reflect.ClassManifest$.arrayType(ClassManifest.scala:205)
at .<init>(<console>:8)
I know that Array[Array[Unit]] doesn't seem useful or important, but, a friend of mine who's learning Scala actually hit this on his first day with the language. It can easily happen if you accidentally omit an equals sign in a method declaration, something like:
deffoo(x: Int, y: Int) { x + y }; Array.tabulate(3, 3)(foo)
The text was updated successfully, but these errors were encountered:
in both 2.9 and trunk,
I know that Array[Array[Unit]] doesn't seem useful or important, but, a friend of mine who's learning Scala actually hit this on his first day with the language. It can easily happen if you accidentally omit an equals sign in a method declaration, something like:
The text was updated successfully, but these errors were encountered: