Skip to content

Cannot mix both fixed and rest arguments using '.call' when using '--strictBindCallApply' #37834

@rbuckton

Description

@rbuckton

TypeScript Version: 3.9.0-dev.20200328

Search Terms: strict call rest arguments

Code

class C {
    use<A extends any[]>(fn: (this: this, obj: this, ...args: A) => void, ...args: A) {
        fn.bind(this, this)(...args); // ok
        fn.bind(this)(this, ...args); // error
        fn.call(this, this, ...args); // error
    }
}

Expected behavior:

The 2nd and 3rd cases above should be ok

Actual behavior:

The 2nd and 3rd cases above report errors.

Playground Link: Playground

Related Issues:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions