You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently refactored a lot of semantic_analysis to use a struct called TypeCheckArguments. This provides a consistent interface across our many type checking functions.
This could save us a ton of LOC -- we are currently manually plumbing parameters in lots of places. Once the above issue gets to rust stable, we should refactor these calls to use this syntax.
The text was updated successfully, but these errors were encountered:
Since most (half? 5/10?) of those args are re-used, would it work to have a type checker struct and just make all the type checks methods? I guess it would be spread across multiple source files, but still fit under the semantic actions type checking umbrella.
I recently refactored a lot of
semantic_analysis
to use a struct calledTypeCheckArguments
. This provides a consistent interface across our many type checking functions.I wanted to be able to do something like this:
However, this implicit cast of
arguments
fromTypeCheckArguments<T>
toTypeCheckArguments<R>
is experimental, and nightly only: rust-lang/rust#86555Without that cast, we have to write this:
This could save us a ton of LOC -- we are currently manually plumbing parameters in lots of places. Once the above issue gets to rust stable, we should refactor these calls to use this syntax.
The text was updated successfully, but these errors were encountered: