I love null being apart of the type system, but the safe call operator seems like a huge step backwards.
Void func doThing(state : State?) {
var idx = state?.idx ?? -1
//No more ?. Needed
}Also I don't see the difference between if(a != null) { a.b(); } and a?.b().
They won't result in NPEs either way and I see the former everywhere in Java as well.
However, Java has instead received `Optional` (in the shape of `Optional.ofNullable(variable).map(Clazz::getProperty).map(Clazz2::getProperty).orElseGet( () -> 42 );` rather than `variable?.getProperty()?.getProperty() ?: 42`).
I don't know what the JCP EC was thinking going for this approach rather than the much more readable, modern approach, but I can't be too surprised about a language designed by committee refusing such improvements.
There are comments in this very discussion praising this change due to how this stuff really improves their life as a developer.
Anyway, can you pass the link to your JEP with a proposal for "?." ?
Maybe Manifold will add the operator somehow. That seems to be the place modern language features that the Java comities don't like end up.