Add errors ection to Part 4 of compiler posts

This commit is contained in:
2019-08-28 15:34:13 -07:00
parent df1101a14c
commit 05af1350c8
7 changed files with 148 additions and 32 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) {