JSAbrahams / mamba

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

Generate identifiers from conditions of match arms #380

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Summary

Match arms treated same way as if arms:

In future should have way to have some sort of union between constraints, much like env. This allows us to type check all possible execution paths.

When we implementing pattern matching this system will need to be extended.

Added Tests

Happy

Sad

codecov[bot] commented 1 year ago

Codecov Report

Merging #380 (7db045b) into develop (63cc218) will increase coverage by 0.06%. The diff coverage is 100.00%.

@@             Coverage Diff             @@
##           develop     #380      +/-   ##
===========================================
+ Coverage    87.00%   87.06%   +0.06%     
===========================================
  Files          109      109              
  Lines        11950    12014      +64     
===========================================
+ Hits         10397    10460      +63     
- Misses        1553     1554       +1     
Impacted Files Coverage Δ
src/check/constrain/generate/control_flow.rs 93.40% <100.00%> (+1.36%) :arrow_up:
src/check/constrain/generate/expression.rs 94.28% <100.00%> (+1.42%) :arrow_up:
src/check/constrain/generate/mod.rs 91.93% <100.00%> (ø)
src/parse/expr_or_stmt.rs 94.38% <0.00%> (-0.62%) :arrow_down:
src/parse/ast/node.rs 79.77% <0.00%> (-0.11%) :arrow_down:
src/check/ast/mod.rs 93.69% <0.00%> (-0.06%) :arrow_down:
src/check/context/clss/generic.rs 93.15% <0.00%> (-0.04%) :arrow_down:
src/generate/ast/mod.rs 92.82% <0.00%> (-0.04%) :arrow_down:
src/check/ast/node.rs 95.75% <0.00%> (-0.02%) :arrow_down:
src/parse/block.rs 100.00% <0.00%> (ø)
... and 9 more