Closed
Description
Create the following source files:
A.scala:
package a
object Foo
B.scala:
package b
import a.Foo
class Foo
Then run
scalac -d ./classes A.scala B.scala
The compilation succeeds.
But if I compile A and B separately:
scalac -d ./classes1 A.scala
scalac -d ./classes2 -cp ./classes1 B.scala
I get "warning: imported `Foo' is permanently hidden by definition of class Foo in package b".
I also get this error if I replace "object Foo" with "class Foo" in A.scala.
I guess this is supposed to succeed, since objects are values, not types, and so live in a different namespaces? But in that case it should also succeed when the files are compiled separately.