Skip to content

2.0: Type parameters not instantiated in construction of class extended with interface in another file #8599

Description

@jeffreymorlan

a.ts:

declare class P<R> {
    constructor(callback: (resolve: (value: R) => void) => void);
}

b.ts:

interface P<R> {}
new P<string>(resolve => {
    resolve('foo'); // "Argument of type 'string' is not assignable to parameter of type 'R'."
});

According to git bisect, this was introduced in #7448

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issue

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions