You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In our Java code, we define Java classes as default implementation in interfaces such as:
interface Foo {
class DefaultFoo implements Foo {
}
}
See the attached file for a simple example: unzip it and try to compile it with:
scalac Foo.java Bar.java Quux.scala
You should get an error:
[error] /Users/pascal/foo/src/main/java/Bar.java:2:34: not found: type DefaultFoo [error] public class DefaultBar extends DefaultFoo implements Bar {
But javac (any version but we use 1.8 131) compiles this Java code.
We tried with Scala 2.11 (many versions) and Scala 2.12.5.
An obvious workaround is to change the java code to public class DefaultBar extends Foo.DefaultFoo
But as we have a huge code base written this way, this is inconvenient.
We also have the same bug inside methods where scala does not see enum defined as subclasses of an interface another Java class extends.
almost certainly a variant of #9111. you could add your reproducer as a comment there. @lrytz had intended to address it at scala/scala#5606 but it proved trickier than expected.
In our Java code, we define Java classes as default implementation in interfaces such as:
interface Foo {
class DefaultFoo implements Foo {
}
}
See the attached file for a simple example: unzip it and try to compile it with:
scalac Foo.java Bar.java Quux.scala
You should get an error:
[error] /Users/pascal/foo/src/main/java/Bar.java:2:34: not found: type DefaultFoo [error] public class DefaultBar extends DefaultFoo implements Bar {
But javac (any version but we use 1.8 131) compiles this Java code.
We tried with Scala 2.11 (many versions) and Scala 2.12.5.
An obvious workaround is to change the java code to public class DefaultBar extends Foo.DefaultFoo
But as we have a huge code base written this way, this is inconvenient.
We also have the same bug inside methods where scala does not see enum defined as subclasses of an interface another Java class extends.
Foo.zip
The text was updated successfully, but these errors were encountered: