Closed
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