Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implements main typechecking functions as traits
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