Closed zerbina closed 4 months ago
Thank you, I've changed the name.
/merge
Merge requested by: @zerbina
Contents after the first section break of the PR description has been removed and preserved below:
## Notes for Reviewers * next up is removing `adSemCalleeHasAnError` and `transitionToError`
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 https://github.com/nim-works/nimskull/issues/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, errorsThe Solution
adWrappedSymError
diagnostic, which is a quiet diagnostic likeadWrappedError
, meaning that it's only used for error propagation and never reportednewSymNode2
fromast
tosem
and change it so that it createsadWrappedSymError
error nodes for symbols where the definition has an errornewSymNode2
tonewSymNodeOrError
newSymNode2
for
-loop-related compiler crash to the newerror_propagation
categoryThe introduction of
adWrappedSymError
is meant to be a foundational work for changingskError
to only represent errors (instead of both errors and symbols whose definition has an error).