Functions can't refine input types in Hack, meaning that if the argument to Str\is_empty is non-null, it won't get refined even if the function returns true. This means that the function is, effectively, not valuable, since checking for emptiness via === '' or a nullcheck is more explicit.
We've found this function in practice to confuse developers, who expect type refinement, so we may deprecate this function and suggest explicit equality checks instead.
Functions can't refine input types in Hack, meaning that if the argument to
Str\is_emptyis non-null, it won't get refined even if the function returns true. This means that the function is, effectively, not valuable, since checking for emptiness via=== ''or a nullcheck is more explicit.We've found this function in practice to confuse developers, who expect type refinement, so we may deprecate this function and suggest explicit equality checks instead.