I have upgraded to Eclipse 4.35RC2 (jumping from 4.33) and I am now seeing a false compile error. The title is my best guess at the scenario in which this happens.
Minimal reproducer:
import java.util.Optional;
public class Snippet {
public static void main(String[] args) {
var d = ("a" == null ? null : 2.0);
Optional.ofNullable("a" == null ? null : 2.0);
}
}
As expected: var d is correctly inferred to be type Double
Unexpected: the same expression on the 2nd line yields this error:
"The method ofNullable(T) in the type Optional is not applicable for the arguments (Double)"
I have upgraded to Eclipse 4.35RC2 (jumping from 4.33) and I am now seeing a false compile error. The title is my best guess at the scenario in which this happens.
Minimal reproducer:
As expected:
var dis correctly inferred to be typeDoubleUnexpected: the same expression on the 2nd line yields this error: