Closed
Description
If the user defines a type guard for a boolean, as in this example:
function isBool(a: any): a is boolean {
return (typeof a === "boolean");
}
function bob() {
var z;
if (isBool(z)) {
z; // type of z is still 'any'
}
}
...then z is not properly refined to 'boolean'. It stays 'any'. I think the expected behavior here is for the type guard to refine to boolean inside of the if check.