Closed
Description
TypeScript Version: 3.8.2-dev.201xxxxx
Search Terms: call apply overload
Code
interface Fn {
(x: string): void;
(x: number, y: boolean): void;
}
declare const f: Fn;
f(''); // ok
f.call(null, ''); // error
f.apply(null, ['']); // error
Expected behavior:
No type errors as f('')
is equivalent to f.call(null, '')
and f.apply(null, [''])
.
Actual behavior:
Type errors on f.call(null, '')
and f.apply(null, [''])
.
Playground Link: Playground Link
Related Issues: