Commit 0298e19
committed
fix(#20456): detect enum type used as value at semantic stage
Add hasValidType() checks after resolveProperties() in visitIf,
visitFor, and visitDo (statementsem.d) so using an enum type name
as a boolean condition (e.g. 'if (Flags)') is caught during
semantic analysis instead of being deferred to e2ir/codegen, which
was silently skipped when compiling with -o-.
Fixes #204561 parent dd4bb63 commit 0298e19
2 files changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
| 662 | + | |
661 | 663 | | |
662 | 664 | | |
663 | 665 | | |
| |||
730 | 732 | | |
731 | 733 | | |
732 | 734 | | |
| 735 | + | |
| 736 | + | |
733 | 737 | | |
734 | 738 | | |
735 | 739 | | |
| |||
1798 | 1802 | | |
1799 | 1803 | | |
1800 | 1804 | | |
| 1805 | + | |
| 1806 | + | |
1801 | 1807 | | |
1802 | 1808 | | |
1803 | 1809 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
0 commit comments