This PR removes the "Widen" type which was there as a fix for return types being referred too narrowly. For instance the return value of getFlag should be of the same type as the default value arg. But if you called getFlag with a 3 as the default value the inferred return type would be 3 instead of number. The Widen type caused some unnecessary complexity though, and now the problem is fixed with overloads instead.
Hi There, I just made a Pull Request!
This PR removes the "Widen" type which was there as a fix for return types being referred too narrowly. For instance the return value of
getFlag
should be of the same type as the default value arg. But if you called getFlag with a3
as the default value the inferred return type would be3
instead ofnumber
. The Widen type caused some unnecessary complexity though, and now the problem is fixed with overloads instead.:heavy_check_mark: Checklist