I think that ty_compare::Canonicalize and ty::SynthType are actually doing the same thing to types (though SynthType also operates on expressions); if so, we should remove Canonicalize (making sure not to call it, of course). If it winds up being the case that ast_walk forces us to keep it around to be paired with Subtype, we should still change get_walk_rule to force them to behave the same way.
Also, ty_compare::resolve is not the same thing, because it needs to deal with underdetermined types... but adding underdetermined type handling to ty::SynthType wouldn't cause any harm, and might let us merge that, too. It also needs to stop after one step; maybe we can write ast_walk::walk_one_step that uses some magic to prevent recursive calls?
I think that
ty_compare::Canonicalize
andty::SynthType
are actually doing the same thing to types (thoughSynthType
also operates on expressions); if so, we should removeCanonicalize
(making sure not to call it, of course). If it winds up being the case thatast_walk
forces us to keep it around to be paired withSubtype
, we should still changeget_walk_rule
to force them to behave the same way.Also,
ty_compare::resolve
is not the same thing, because it needs to deal with underdetermined types... but adding underdetermined type handling toty::SynthType
wouldn't cause any harm, and might let us merge that, too. It also needs to stop after one step; maybe we can writeast_walk::walk_one_step
that uses some magic to prevent recursive calls?