I cannot reference Scala classes from Java code when using Eclipse IDE. The Scala class in question is nested within a Scala-object structure. When trying to use the class in Java code, Eclipse complains about using the binary name.
Below is an example of Scala code defining the class of interest (Inner):
package mypackage;
object Outer {
object Middle {
class Inner {
def msg() {
println("Running");
}
}
}
}
To use the class Inner in Java code, I use the following code:
mypackage.Outer$Middle$Inner inner = new mypackage.Outer$Middle$Inner();
inner.msg();
However, Eclipse (Indigo) compiler complains with the following message at the first line:
The nested type mypackage.Outer$Middle$Inner cannot be referenced using its binary name
Interestingly, the Java code above works when used with NetBeans 6.9.1.
Is this an issue with Eclipse compiler? Are there any flags to allow using binary names? Or, alternatively, is this an issue with Scala or the way I am using it?