I have a scala project that is generating a jar. I'm trying to use the jar in a Java project. The weird thing is the method signatures are losing generic type information when they are compiled to .class files.
def foo(x:List[Long]) = ...
generates a method with
Lscala/collection/immutable/List<Ljava/lang/Object;>
in its .class file.
It's the same with
def foo(x:java.util.List[Long]) = ...
the .class file says the method signature is
Ljava/util/List<Ljava/lang/Object;>
The real problem is that when I use this jar in a Java project I have to use List<Object>
instead of List<Long>
like I want. Sure I can cast it, but I would rather not have to. Any ideas?
I am using scala version 2.11.7