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 on errors in deref expressions (#955)
## Summary Fix the compiler crashing when the target sub-expression of a dereference expressions (`a[]`) is erroneous. ## Details The error propagation in `semDerefEval` correctly detected that the target expression is erroneous, but didn't update the `result` with the erroneous tree prior to wrapping `result` in an error. Since `wrapError` requires an `nkError` to be located somewhere in the wrapped tree, this triggered an assertion failure. In addition, errors during folding (`getConstExpr` returning an `nkError`) weren't accounted for. This is fixed by testing `semmedTarget` (not `derefTarget`) for being erroneous.
- Loading branch information