Aladdin - Scala Bugtracking
[#733] project: interpreter priority: low category: bug
submitter assigned to status date submitted
Nikolay Lex fixed 2006-09-05 11:29:43.0
subject [contrib #182] Array.apply strangely missing from Scala scripts
code
Console.println(Array(1,2,3))
what happened
The above works fine if run from the interactive prompt, but trying to run a Scala 5cr1p7-haX0R file containing the sa\
me gives:
test.scala:1 error: Array does not take parameters
Console.println(Array(1,2,3))
                     ^
one error found
what expected Should work in both cases.
[back to overview]
Changes of this bug report
Nikolay  edited on  2006-09-05 11:31:59.0
It works if Predef.Array is used. BTW, cannot we deal with the Array family of methods in the way we use for constructing Lists, with an apply method in the List object? Can we have overloaded apply method?
Nikolay  edited on  2006-09-05 15:22:44.0
Reassigned to Lex
Nikolay  edited on  2006-09-05 19:53:01.0
I moved Predef.Array* to scala.Array.apply. Everything looks fine but I imagine it breaks binary compatibility in code that used the Predef.Array methods which are no longer there. Also, it fixes the simptom observed in this bug report but not the problem that caused it.
Lex  edited on  2006-09-21 15:33:24.0
I have changed scripts to be run from within the "scalascript" package instead of "scala.scripting". This should mean that scripts get the same initial environment as most any other Scala code that is not part of the scala.* hierarchy.