Java interop: can Scala emit bytecode enumerations to use Java?

I have a project mixed with Java / Scala, it is a Java GUI code that uses the Scala library. Is there a way to write Scala code to give Java variables at compile time? The approaches I've tried so far (case private classes, Enumeration extension) seem to generate normal classes, which makes working with them much more hairy than direct enumerations.

+6
java enums scala bytecode interop
source share
2 answers

Why can't you write your enum class in Java? Projects with a mixed source (i.e. Java + Scala) are quite possible ...

+4
source share

Scala only supports Java 1.4 features.

Java are listed in Java 1.5.

0
source share

All Articles