if(a)
a.thingy()
now has ?. as useful syntactic sugar for it?
a?.thingy()
It'd be useful if there was something similar for this
var/obj/item/a = thingy
if(istype(a))
a.do_thingy()
Similar to ?., but it checks to ensure the var is the proper type at runtime. I'm not sure what the best operator for this would be, tho.
I've used this before, though it's missing a dynamic return type:
I think it would have to be a built-in instruction to tell the compiler that the type must be constant and the expression returns that type of object, for the ?. operator to know what type to go with.