Closed
Description
β― Playground Link
Playground link with relevant code
π» Code
class A {
greet() {}
}
class C {
constructor() {
return new A();
}
}
let instance: A = new C() // error
π Actual behavior
Property 'greet' is missing in type 'C' but required in type 'A'.(2741)
π Expected behavior
I think that compiler should infer that the constructor will return an instance of a different class
Metadata
Metadata
Assignees
Labels
No labels