JSAbrahams / mamba

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

Fix nullablility rules for field access #394

Closed JSAbrahams closed 1 year ago

JSAbrahams commented 1 year ago

Summary

Now, the expression at the site must be the super of any of the types mentioned in the union of types of the argument. We do this by introducing a boolean any in the Name struct. This then changes the behavior when set to true of is_superset_of, where if other's any is true, then self will the super of the other if just one TrueName in the union is a super of the other. Not sure if this logic is completely right. Perhaps it should be that for each TrueName in self, it should be the super of at least one. But I'm leaving it as-is for now.

Added Tests

Happy

Sad

codecov[bot] commented 1 year ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (v-0-3-5@986ffda). Click here to learn what that means. The diff coverage is n/a.

@@            Coverage Diff             @@
##             v-0-3-5     #394   +/-   ##
==========================================
  Coverage           ?   87.39%           
==========================================
  Files              ?      109           
  Lines              ?    12028           
  Branches           ?        0           
==========================================
  Hits               ?    10512           
  Misses             ?     1516           
  Partials           ?        0