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
There are certain scenarios where properties can be initialized indirectly (perhaps by a helper method or dependency injection library), in which case you can use the new definite assignment assertion modifiers for your properties (discussed below).
@Kingwl Definite
"Assignment Assertions" is a very bad practice, and I will not use it with serious projects, because it can very easily break the code.
it can check the constructor function.
why can not it test other methods for initialization?
TypeScript Version: 2.7.2
Code
--strictNullChecks
--strictPropertyInitialization
Expected behavior:
no errors
Actual behavior:
Property 'c' has no initializer and is not definitely assigned in the constructor.
Playground Link:
https://goo.gl/uP2yKq
The text was updated successfully, but these errors were encountered: