nim-works / nimskull

An in development statically typed systems programming language; with sustainability at its core. We, the community of users, maintain it.
https://nim-works.github.io/nimskull/index.html
Other
279 stars 39 forks source link

sem: fix crash due to incorrect error handling #1372

Closed zerbina closed 4 months ago

zerbina commented 4 months ago

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, errors

The Solution

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).

zerbina commented 4 months ago

Thank you, I've changed the name.

zerbina commented 4 months ago

/merge

github-actions[bot] commented 4 months ago

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`