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
(Compile with strictNullChecks and strictPropertyInitialization enabled)
Expected behavior:
Code compiles because the testvalue property is always defined in a class instance. Even though it's not directly in the constructor.
Actual behavior:
Compiler gives the error:
src/initializer.ts:2:12 - error TS2564: Property 'testValue' has no initializer and is not definitely assigned in the constructor.
2 public testValue: string;
~~~~~~~~~
Playground Link: Link to the playground
Enable strictNullChecks and strictPropertyInitialization
Related Issues:
I did not find any related issues.
The text was updated successfully, but these errors were encountered:
TypeScript Version: 3.0.0-dev.20180526
Search Terms:
Initializer nested function
Code
(Compile with
strictNullChecks
andstrictPropertyInitialization
enabled)Expected behavior:
Code compiles because the
testvalue
property is always defined in a class instance. Even though it's not directly in the constructor.Actual behavior:
Compiler gives the error:
Playground Link:
Link to the playground
Enable
strictNullChecks
andstrictPropertyInitialization
Related Issues:
I did not find any related issues.
The text was updated successfully, but these errors were encountered: