▲ | imbnwa 7 months ago | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
They really ruined Optional not solving this then and there | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | cogman10 7 months ago | parent [-] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
There would always be a hole that's somewhat impossible to fill with the language as is. If you have something like
if `1` isn't present in the map then `foo` has to be set to something. It will be `null` in this case.If the new null restricted stuff makes it in, you can express this as
and yet, `foo` will still end up being `null` in that case (I assume) because something has to come back if `1` isn't present.At best, that will prevent you from doing `map.put(1, null);` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|