We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It is permitted not to initialize a static field:
static
class Foo { static bar: string } const baz = Foo.bar // inferred string console.log(typeof baz) // is undefined
static class field property undefined error assigned
This bug has always been here, as far as I checked (3.3.3).
Playground link with relevant code
class Foo { static bar: string } const baz = Foo.bar // string console.log(typeof baz) // undefined
undefined values will certainly lead to a program crash.
undefined
Either to be suggested to assign a default value or to mark the field as optional.
The text was updated successfully, but these errors were encountered:
Duplicate of #27899. Search terms: static undefined
static undefined
Sorry, something went wrong.
This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.
No branches or pull requests
Bug Report
It is permitted not to initialize a
static
field:🔎 Search Terms
static class field property undefined error assigned
🕗 Version & Regression Information
This bug has always been here, as far as I checked (3.3.3).
⏯ Playground Link
Playground link with relevant code
💻 Code
🙁 Actual behavior
undefined
values will certainly lead to a program crash.🙂 Expected behavior
Either to be suggested to assign a default value or to mark the field as optional.
The text was updated successfully, but these errors were encountered: