-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug
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
Metadata
Metadata
Assignees
Labels
Working as IntendedThe behavior described is the intended behavior; this is not a bugThe behavior described is the intended behavior; this is not a bug