johnynek / bosatsu

A python-ish pure and total functional programming language
Apache License 2.0
224 stars 11 forks source link

leverage UnionRelatable #1116

Closed johnynek closed 8 months ago

johnynek commented 8 months ago

The idea here is to use the UnionRelModule to improve relation computation for Patterns.

Computing the relationships of patterns in the presence of nested unions and non-normalized representations is pretty challenging.

The UnionRelModule allows you to have a recursive structure that is well tested. So you only have to solve simpler problems and be sure it's correct.

This and the added test coverage wound up fixing some lurking bugs in the original set relationship calculations on Patterns, but since TotalityCheck is only a compilation lint, the bugs could only have manifested by a runtime error of a non-total pattern match (which I never saw so far).

codecov-commenter commented 8 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (7956d1e) 92.53% compared to head (177a16e) 92.65%.

Files Patch % Lines
...rc/main/scala/org/bykn/bosatsu/TotalityCheck.scala 92.30% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1116 +/- ## ========================================== + Coverage 92.53% 92.65% +0.11% ========================================== Files 96 96 Lines 10864 10916 +52 Branches 2549 2588 +39 ========================================== + Hits 10053 10114 +61 + Misses 811 802 -9 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.