Closed
Description
Wonder if this is something that should work. I think it should:
try {
throw new Error('awesome');
} catch (ex) {
if (ex instanceof Error) {
console.log(ex.foo); // compiles. Should be error
}
}
The reason is that ex
is still of type any
. I suspect its in the spec that instanceof
guard will not work on type any
(I haven't checked).
Would be great if we could have this though.