The PR strictly fixes the issue reported in #6388. It does not fix a previously known, more general issue, described in #5097 where we expect warnings to be emitted also on individual elements of an OR arm, even if the whole arm is reachable. E.g.:
match v {
1 => (),
2 => (),
1 | 3 => (), <<<--- Warning should be emitted here that `1` is not reachable.
2 | 4 => (), <<<--- Warning should be emitted here that `2` is not reachable.
_ => (),
};
Fixing this issue requires more invasive restructuring of the propagation of the collected witness information and will be done in a separate PR.
Closes #6388.
Checklist
[x] I have linked to any relevant issues.
[x] I have commented my code, particularly in hard-to-understand areas.
[ ] I have updated the documentation where relevant (API docs, the reference, and the Sway book).
Description
This PR fixes #6388. If a whole OR match arm is unreachable a warning will be emitted like in this case:
The PR strictly fixes the issue reported in #6388. It does not fix a previously known, more general issue, described in #5097 where we expect warnings to be emitted also on individual elements of an OR arm, even if the whole arm is reachable. E.g.:
Fixing this issue requires more invasive restructuring of the propagation of the collected witness information and will be done in a separate PR.
Closes #6388.
Checklist
Breaking*
orNew Feature
labels where relevant.