paulstansifer / unseemly

Macros have types!
http://unseemly.github.io/
MIT License
129 stars 5 forks source link

Merge `ty_compare::Canonicalize` and `ty::SynthType` #28

Open paulstansifer opened 5 years ago

paulstansifer commented 5 years ago

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?