JSAbrahams / mamba

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

Fix check access of nested fields of object #339

Closed JSAbrahams closed 2 years ago

JSAbrahams commented 2 years ago

Relevant issues

Summary

Fix #297 by recursively for each inner call also generating a constraint.

An example

x.y.z is turned into:

Then in the unifcation stage:

Added Tests

JSAbrahams commented 2 years ago

Perhaps we are missing a substitute rule for access somewhere, though that does seem unlikely. Also, it would be nice if we can get rid of all duplicate constraints before going into the unification stage, also for a more succinct trace. I've tried to check before adding but didn't work yet for some reason.

codecov[bot] commented 2 years ago

Codecov Report

Merging #339 (82bbaa1) into develop (28b4109) will increase coverage by 0.18%. The diff coverage is 95.23%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop     #339      +/-   ##
===========================================
+ Coverage    86.39%   86.57%   +0.18%     
===========================================
  Files          109      109              
  Lines        11649    11637      -12     
===========================================
+ Hits         10064    10075      +11     
+ Misses        1585     1562      -23