rems-project / sail

Sail architecture definition language
Other
563 stars 92 forks source link

Add type environment annotations to top level definitions #570

Closed bacam closed 3 weeks ago

bacam commented 3 weeks ago

This adds the type environment used to check each definition to its annotation, although it doesn't use them yet.

I've wanted this for a while to avoid having to find a suitable environment from deeper inside the definition, but finally came across a case where it's awkward to work around (a missing case for overloads in the top-sort rewrite).

It touches quite a lot, so I thought I'd ask for feedback before merging. In retrospect, I might add a typed_ast alias to reduce the amount of visual clutter.

github-actions[bot] commented 3 weeks ago

Test Results

    9 files  ±0     20 suites  ±0   0s :stopwatch: ±0s   641 tests ±0    641 :white_check_mark: ±0  0 :zzz: ±0  0 :x: ±0  2 053 runs  ±0  2 052 :white_check_mark: ±0  1 :zzz: ±0  0 :x: ±0 

Results for commit 3b125605. ± Comparison against base commit 5bbb8dbc.

:recycle: This comment has been updated with latest results.

Alasdair commented 3 weeks ago

Looks good to me. It something I've thought of doing but was a bit put off by the amount of changes needed.

I think a typed_ast alias would be a good idea.