Closed
Description
TS 2.0.3
See the comments and last line in the code below for expected/actual.
{
type Foo = { foo: true };
const isFoo = (foo: Foo) => foo.foo;
const xs = [{ foo: true }, undefined];
isFoo(xs[1]) // good, errors
const x = undefined as Foo | undefined;
isFoo(x) // good, errors
xs.filter(isFoo) // bad, didn't fail, expected filter arg to fail, should be Foo | undefined
}