Suppose I have a type alias defined in scala as
object Foo { type Bar = Option[String] }
It looks like I can't reference an alias in Java code like this (it just complains that it cannot find the character):
import Foo.*; public class Cafebabe { void bar(Bar x) {
I also tried static imports.
(More specifically, I have a java reflection code that I cannot change that needs to know the type of the parameter, and I need to pass it the alias Bar).
I know I can create a wrapper in Scala
class BarWrapper(value: Bar)
but maybe I missed some other way?
java scala scala-java-interop type-alias
om-nom-nom
source share