Skip to content

Commit

Permalink
Implements main typechecking functions as traits (#2129)
Browse files Browse the repository at this point in the history
This commit cleans the typechecker code by gathering functions that are
implemented by several Rust types as traits, instead of having a lot of
free-standing variations `walk_foo`, `walk_bar`, etc. This also allows
for some code deduplication for example when walking an array of
walkable element, that can be factored out.

`infer` is a bit of an exception since it relies on `check` and is only
implemented on one type. Still, in the sake of consistency, `infer` gets
its trait as well (including for calling convention - it would be a bit
odd to call `value.check(..)` but `infer(.., value, ..)`).
  • Loading branch information
yannham authored Dec 23, 2024
1 parent 002f0fc commit 026e43b
Show file tree
Hide file tree
Showing 2 changed files with 791 additions and 750 deletions.
Loading

0 comments on commit 026e43b

Please sign in to comment.