I have a Java method that accepts a Long value:
(in Java)
public void setValue(Long value);
I understand that the Scala null does not extend any of the value types, including Long. Therefore, when I try to pass null to it, I get a compilation error:
(in Scala)
javaThing.setValue(null)
==> type mismatch; found : Any required: java.lang.Long
EDIT: aargh! Ignore above snippet. I oversimplified the problem, and got into trouble. In fact, problem arises from my use of Option[Long], as follows:
javaThing.setValue(calcValue.getOrElse(null))
The issue is, I think, that getOrElse evaluates to the Any type when given a null argument.
Help!