Cannot run a Scala source as a script

Hi All,

this file can be started with the Scala script runner ´scala test.scala´, but it doesn't print anything:

---------- test. scala -----------
object A
object Y {
def main(args: Array[String]) {
println("running")
}
}
----------------------------------

If I comment out the ´object A´ line, then all is OK, the string "running" is printed.

Why is it so? Is it possible to make the script working with additional definitions
(classes/objects/traits) in the file?

Thanks,
Eugen

see also:
https://lampsvn.epfl.ch/trac/scala/browser/scala/tags/R_2_9_1_final/src/...

Copyright © 2013 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland