JSAbrahams / mamba

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

Flip function access constraint generation #239

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 2 years ago

Relevant issues

Resolves #228

Summary

Now, the thing the function return type is being compared to must be the super. This makes sense, as a function may return a subset of the type its value is being assigned to, but not the other way around.

Added Tests

codecov[bot] commented 2 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (develop@da1685c). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #239   +/-   ##
==========================================
  Coverage           ?   79.69%           
==========================================
  Files              ?       99           
  Lines              ?     8623           
  Branches           ?        0           
==========================================
  Hits               ?     6872           
  Misses             ?     1751           
  Partials           ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update da1685c...d1a6161. Read the comment docs.

JSAbrahams commented 2 years ago

Well #228 appears to have been resolved, but you can't actually annotate tuples in Python so I'll have to modify the desugar stage.