Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(sem): crash due to ill-formed
if
AST (#933)
## Summary Fix the compiler crashing when encountering ill-formed `nkIfStmt`/ `nkIfExpr` AST and the maximum error count is larger than 1. ## Details * in `semIf`, create an error node for the ill-formed branch instead of creating and reporting a `Report` * this enables proper `nkError` propagation, which disables the second pass, preventing the invalid AST from being indexed into (this caused either an `IndexDefect` or `FieldDefect`) * in addition, this also removes another use of immediate reporting via `handleReport`/`localReport` --------- Co-authored-by: zerbina <100542850+zerbina@users.noreply.github.com>
- Loading branch information