Skip to content

Implicit any issue with overloaded methods #11936

Closed
@tinganho

Description

@tinganho

This code was working for me before but broken in the latest:

class A {
    forEach(callback: (a: number) => void): void
    forEach(callback: (a: number, b: number) => void): void
    forEach(callback: (a: number, b?: number) => void): void {

    }
}

const a = new A();
a.forEach((a, b)=> { // Parameter 'a' and 'b' implicitly has an 'any' type
})

Metadata

Metadata

Assignees

Labels

Breaking ChangeWould introduce errors in existing codeBugA bug in TypeScriptDesign LimitationConstraints of the existing architecture prevent this from being fixed

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions