I’m using http://fastutil.di.unimi.it/docs/it/unimi/dsi/fastutil/longs/Long2ObjectMap.html from Scala 2.11.8. The same happens from 2.11.12. I’m using Long2ObjectMap, which has two
V remove(final Object key); // from java.util.Map V remove(final long key); // from it.unimi.dsi.fastutil.longs.Long2ObjectFunction
Unfortunately I’m not able to call
remove because Scala thinks the first one takes
AnyRef), the second takes
long, which is also an
Any, and so I get the error,
Error:(94, 15) ambiguous reference to overloaded definition, both method remove in trait Long2ObjectMap of type (x$1: Any)V and method remove in trait Long2ObjectFunction of type (x$1: Long)V match argument types (Long) builder.remove(x)
Is there a way to tell Scala to use the method that takes
long? I can add
: Any to my parameter to get it to use the
(Object) one, but that’s not ideal.
: Long doesn’t help.