Skip to content

Calling function with bound arguments #4602

Open
@borlaym

Description

@borlaym

Example

type bound = (number) => void

const foo:bound = (a: number) => console.log(a);
const bar:bound = foo.bind(this, 3);

bar();

8: bar();
   ^ undefined (too few arguments, expected default/rest parameters). This type is incompatible with
3: type bound = (number) => void
                 ^ number

Is this a bug, or am I doing something wrong? What's the best practice to handle this kind of situation?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions