You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
not reproducible on -d:danger builds of nimskull. is this a kind of inverse heisenbug?
In -d:danger builds, assertions are disabled, meaning that the assertion can never trigger. Since b is still wrapped in an error node, subsequent processing of the procedure is disabled, and a proper error is reported (it might not, I haven't tested it yet).
## Summary
Wrap usage of erroneous symbols in quiet errors, so that error
propagation works as expected. This fixes compiler/nimsuggest crashes
when the iterable expression in `for` loops has an error.
Fixes#1369.
## Details
### The Problem
If the iterable slot of a `for` loop is an error, `tyError` is assigned
as the forvars' type. When such forvar appears as an argument in a call
expression, errors
### The Solution
* add the `adWrappedSymError` diagnostic, which is a quiet diagnostic
like `adWrappedError`, meaning that it's only used for error
propagation and never reported
* move `newSymNode2` from `ast` to `sem` and change it so that it
creates `adWrappedSymError` error nodes for symbols where the
definition has an error
* rename `newSymNode2` to `newSymNodeOrError`
* update the few usages of `newSymNode2`
* add test for the `for`-loop-related compiler crash to the new
`error_propagation` category
The introduction of `adWrappedSymError` is meant to be a foundational
work for changing `skError` to only represent errors (instead of both
errors and symbols whose definition has an error).
Example:
Traceback:
The text was updated successfully, but these errors were encountered: