-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
FixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
TypeScript Version: 2.3.2
Code
class A {
a: number;
}
class Aplus extends A {
plus = () => true;
}
function newAplusAsync(): Promise<Aplus> {
return Promise.resolve(new A());
}
(async () => {
const aplus = await newAplusAsync();
console.log(aplus.plus());
})();Expected behavior:
Compiler error: Type 'Promise<A>' is not assignable to type 'Promise<Aplus>'
Actual behavior:
Runtime error: aplus.plus is not a function
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
FixedA PR has been merged for this issueA PR has been merged for this issue