Add errors ection to Part 4 of compiler posts

This commit is contained in:
2019-08-28 15:34:13 -07:00
parent 2dd81cf07a
commit b065d95804
6 changed files with 64 additions and 16 deletions

View File

@@ -1,6 +1,7 @@
#include "type.hpp"
#include <sstream>
#include <algorithm>
#include "error.hpp"
void type_var::print(const type_mgr& mgr, std::ostream& to) const {
auto it = mgr.types.find(name);
@@ -87,7 +88,7 @@ void type_mgr::unify(type_ptr l, type_ptr r) {
if(lid->name == rid->name) return;
}
throw 0;
throw unification_error(l, r);
}
void type_mgr::bind(const std::string& s, type_ptr t) {