hazel
hazel copied to clipboard
Fix the stacked error holes for cases with multiple branches
This pull request fixes the "stacked error holes" issue for case expressions with multiple branches:
This is what'll happen in the current Hazel. The reason is that the ids of |
for each rule is added to M.error_ids
before the type checking (I believe at the stage of parsing), so they can be error-wrapped. Yet the ids of the rules point to the info of the whole case expression, so when the whole case expression is erroneous, multiple error holes will occur.
This pull request tries to fix this by filtering out all the unrepresentative ids in M.error_ids
, such that the ids of |
for each rule will be filtered out.
Not sure if there is a better way to do this though.