You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classX{constructor(){return{b: 42};}}// EXPECTED: The value X should be of type `new () => { b: number }`// REALITY: The value X is of type `new () => {}`constx=newX();// EXPECTED: The value x should be of type X, which should equate to type `{ b: number }`// REALITY: The value x is of type X, which equates to `{}`x.b// UNEXPECTED ERROR
🙁 Actual behavior
Classes with no properties/methods defined outside the constructor have a return type of {}
🙂 Expected behavior
I expected classes to be typed correctly, and reflect the type that they actually return.
The text was updated successfully, but these errors were encountered:
Bug Report
Irregular Class Return Values not being Reflected Correctly with Types in TS
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
Classes with no properties/methods defined outside the constructor have a return type of
{}
🙂 Expected behavior
I expected classes to be typed correctly, and reflect the type that they actually return.
The text was updated successfully, but these errors were encountered: