Commit cdebf75
fix(compiler-cli): used before declared diagnostic not firing for control flow blocks (#56843)
When we process `@if` and `@for` blocks, we create a scope around their expressions in order to encapsulate the aliases to them. The problem is that this doesn't represent the actual structure since the expression is part of the outer scope. This surfaces by not raising the "used before declared" diagnostic for `@let` declarations.
These changes resolve the issue by processing the expression as a part of the parent scope.
Fixes #56842.
PR Close #568431 parent 66e5825 commit cdebf75
File tree
2 files changed
+92
-10
lines changed- packages/compiler-cli
- src/ngtsc/typecheck/src
- test/ngtsc
2 files changed
+92
-10
lines changedLines changed: 9 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1647 | 1647 | | |
1648 | 1648 | | |
1649 | 1649 | | |
1650 | | - | |
1651 | | - | |
| 1650 | + | |
| 1651 | + | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
1657 | 1657 | | |
1658 | | - | |
| 1658 | + | |
1659 | 1659 | | |
1660 | 1660 | | |
1661 | 1661 | | |
1662 | 1662 | | |
1663 | | - | |
| 1663 | + | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | | - | |
| 1666 | + | |
1667 | 1667 | | |
1668 | 1668 | | |
1669 | 1669 | | |
| |||
1889 | 1889 | | |
1890 | 1890 | | |
1891 | 1891 | | |
1892 | | - | |
| 1892 | + | |
1893 | 1893 | | |
1894 | 1894 | | |
1895 | 1895 | | |
| |||
Lines changed: 83 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5818 | 5818 | | |
5819 | 5819 | | |
5820 | 5820 | | |
5821 | | - | |
| 5821 | + | |
5822 | 5822 | | |
5823 | 5823 | | |
5824 | 5824 | | |
| |||
7342 | 7342 | | |
7343 | 7343 | | |
7344 | 7344 | | |
| 7345 | + | |
| 7346 | + | |
| 7347 | + | |
| 7348 | + | |
| 7349 | + | |
| 7350 | + | |
| 7351 | + | |
| 7352 | + | |
| 7353 | + | |
| 7354 | + | |
| 7355 | + | |
| 7356 | + | |
| 7357 | + | |
| 7358 | + | |
| 7359 | + | |
| 7360 | + | |
| 7361 | + | |
| 7362 | + | |
| 7363 | + | |
| 7364 | + | |
| 7365 | + | |
| 7366 | + | |
| 7367 | + | |
| 7368 | + | |
| 7369 | + | |
| 7370 | + | |
| 7371 | + | |
| 7372 | + | |
| 7373 | + | |
| 7374 | + | |
| 7375 | + | |
| 7376 | + | |
| 7377 | + | |
| 7378 | + | |
| 7379 | + | |
| 7380 | + | |
| 7381 | + | |
| 7382 | + | |
| 7383 | + | |
| 7384 | + | |
| 7385 | + | |
| 7386 | + | |
| 7387 | + | |
| 7388 | + | |
| 7389 | + | |
| 7390 | + | |
| 7391 | + | |
| 7392 | + | |
| 7393 | + | |
| 7394 | + | |
| 7395 | + | |
| 7396 | + | |
| 7397 | + | |
| 7398 | + | |
| 7399 | + | |
| 7400 | + | |
| 7401 | + | |
| 7402 | + | |
| 7403 | + | |
| 7404 | + | |
| 7405 | + | |
| 7406 | + | |
| 7407 | + | |
| 7408 | + | |
| 7409 | + | |
| 7410 | + | |
| 7411 | + | |
| 7412 | + | |
| 7413 | + | |
| 7414 | + | |
| 7415 | + | |
| 7416 | + | |
| 7417 | + | |
| 7418 | + | |
| 7419 | + | |
| 7420 | + | |
| 7421 | + | |
| 7422 | + | |
| 7423 | + | |
| 7424 | + | |
| 7425 | + | |
| 7426 | + | |
7345 | 7427 | | |
7346 | 7428 | | |
7347 | 7429 | | |
0 commit comments