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
According to this feature we should be able to define properties inside constructors.
It does work, but your playground is incorrectly set to TypeScript, not JavaScript. This is currently a JavaScript only feature (the issue title mentions JavaScript). TypeScript support is tracked at #12613.
I see! That's unexpected that the same code behaves differently based on file type. I'd expect the difference to be type annotations or no type annotations, but not different forms of type inference.
Bug Report
According to this feature we should be able to define properties inside constructors.
🔎 Search Terms
class property inference in constructor not working
🕗 Version & Regression Information
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
TS does not recognize that the property exists
🙂 Expected behavior
TS should recognize that the property exists
The text was updated successfully, but these errors were encountered: