TypeScript
TypeScript copied to clipboard
1.8: type guard no longer narrows from {} to primitive
This works in 1.7:
var a: {};
if (typeof a === 'number') {
var b: number = a;
}
but in the master branch, a is not narrowed and you get an error. This seems to have started with commit febda00f1b430761df7e0e90bbb99cf8c99e4653
:clap: :clap: @weswigham