Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
don't cascade vmgen errors in nim check without error outputs (#24365)
refs #23625, refs #24289 Encountered in #24360 but could not reproduce minimally: overloading on static parameters can work with the normal compile commands but crash `nim check`. Static overloading relies on `tryConstExpr` which recovers from things like `globalError` and fails softly, in this case this can happen when a variable etc. is not available to evaluate in the VM. But with `nim check`, the compiler does not throw an exception in this case, and instead tries to keep generating the entire expression in the VM, which can cause crashes. To fix this, when the compiler has no error outputs even on `nim check`, we raise a global error so that the VM code generation stops early. This fixes both `tryConstExpr` and speeds up `nim check`, because no error outputs means we don't need cascading errors.
- Loading branch information