TypeScript/tests/cases/conformance/types/thisType/thisTypeInTypePredicate.ts

3 lines
141 B
TypeScript
Raw Normal View History

declare function filter<S>(f: (this: void, x: any) => x is S): S[];
const numbers = filter<number>((x): x is number => 'number' == typeof x)