Commit 57a55d3
authored
Enforce strict field initialization (#1349)
BREAKING CHANGE: Instance fields not definitely assigned within the constructor now yield an error, unless the field's name is annotated with a trailing `!` (checked at runtime), is of a nullable or is of a value type (initialized to zero). Fields of non-nullable reference types must be assigned before `this` is either implicitly or explicitly returned from the constructor, passed to another function or another instance method is called on `this`. Overall the behavior is similar to, but not exactly the same as `--strictPropertyInitialization` in TypeScript.1 parent 2f525c0 commit 57a55d3
File tree
36 files changed
+4132
-1039
lines changed- src
- extra
- util
- tests/compiler
- issues
- rt
- std
36 files changed
+4132
-1039
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
758 | 760 | | |
759 | 761 | | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
760 | 772 | | |
761 | 773 | | |
762 | 774 | | |
| |||
1518 | 1530 | | |
1519 | 1531 | | |
1520 | 1532 | | |
1521 | | - | |
1522 | | - | |
| 1533 | + | |
1523 | 1534 | | |
1524 | 1535 | | |
1525 | 1536 | | |
1526 | 1537 | | |
| 1538 | + | |
1527 | 1539 | | |
1528 | 1540 | | |
1529 | 1541 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2894 | 2894 | | |
2895 | 2895 | | |
2896 | 2896 | | |
2897 | | - | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
2898 | 2900 | | |
2899 | 2901 | | |
2900 | 2902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments