Any specific reason why Hack doesn't automatically infer nullable types? Instead you have to write ?
explicitly. If it used inference instead, wouldn't it be able to check for null for regular PHP programs as well?
For example, this function would have type bool -> ?string
:
function foo($condition) {
if ($condition) {
return null;
else {
return 'a string';
}
}