Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC007] Cleanup post "typechecker migration, part I" #2129

Merged
merged 1 commit into from
Dec 23, 2024

Conversation

yannham
Copy link
Member

@yannham yannham commented Dec 23, 2024

This is a clean-up following #2121.

This PR 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, ..)).

@yannham yannham requested a review from jneem December 23, 2024 13:01
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, ..)`).
@yannham yannham force-pushed the rfc007/typechecking-traits branch from a7c1c8d to 605f7bf Compare December 23, 2024 13:32
@yannham yannham added this pull request to the merge queue Dec 23, 2024
Merged via the queue into master with commit 026e43b Dec 23, 2024
5 checks passed
@yannham yannham deleted the rfc007/typechecking-traits branch December 23, 2024 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants