JSAbrahams / mamba

🐍 The Mamba programming language, because we care about safety
MIT License
85 stars 3 forks source link

Propagate outward if else constraint #407

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Relevant issues

Summary

Remove unnecessary creation of further sets in the builder in:

This means that a proper constraint is generated for a whole if statement in the outer set (in which the if is defined). Before, a new set was created meaning that this information was lost when exiting the set right after the if.

Added Tests

Happy

codecov[bot] commented 1 year ago

Codecov Report

Merging #407 (31baaeb) into develop (dbeb53e) will decrease coverage by 0.01%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #407      +/-   ##
===========================================
- Coverage    87.56%   87.54%   -0.02%     
===========================================
  Files          109      109              
  Lines        12035    12019      -16     
===========================================
- Hits         10538    10522      -16     
  Misses        1497     1497              
Impacted Files Coverage Δ
src/check/constrain/constraint/builder.rs 88.46% <ø> (-0.63%) :arrow_down:
src/check/constrain/generate/definition.rs 89.86% <ø> (-0.71%) :arrow_down:
src/check/constrain/generate/control_flow.rs 92.38% <100.00%> (-0.28%) :arrow_down:
src/check/constrain/mod.rs 71.11% <100.00%> (+1.34%) :arrow_up: