Skip to content

Bind and Apply calls are not checked against all function overloads #38353

Closed
@rkirov

Description

@rkirov

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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Design LimitationConstraints of the existing architecture prevent this from being fixed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions