Make substitution replace types at every lookup step

This commit is contained in:
2020-04-13 17:59:57 -07:00
parent 2a936927a1
commit 207efc7ded
3 changed files with 38 additions and 32 deletions

View File

@@ -86,6 +86,9 @@ struct type_mgr {
type_ptr new_arrow_type();
void unify(type_ptr l, type_ptr r);
type_ptr substitute(
const std::map<std::string, type_ptr>& subst,
const type_ptr& t) const;
type_ptr resolve(type_ptr t, type_var*& var) const;
void bind(const std::string& s, type_ptr t);
void find_free(const type_ptr& t, std::set<std::string>& into) const;