Closed
Description
TypeScript Version: 2.4.2
class A {
}
export class B {
public method<T extends A>(val: T): Promise<T> {
return new Promise(resolver => {
resolver(new A());
});
}
}
It fails with this
Argument of type 'A' is not assignable to parameter of type 'T | PromiseLike'.
Type 'A' is not assignable to type 'PromiseLike'.
Property 'then' is missing in type 'A'.
This code compiled just fine in 2.3
It looks similar to this old bug which compiled fine with 2.3, but fails with 2.4
#13993