Reputation: 44352
In Scala, I have two files each defining an Object. Both defined in the same package.
When I try to reference ClassA in object2, I get an error that ClassA cannot be found.
What am I doing wrong? If the objects are in the same default namespace, shouldn't they be able to see each other?
Upvotes: 1
Views: 51
Reputation: 1032
Have you tried this:
object object2{
def main(args: Array[String]) {
val a = new object1.ClassA()
}
}
Upvotes: 2