Refactor errors and update post draft.

This commit is contained in:
2020-09-11 21:29:49 -07:00
parent 4cdb9360fb
commit 03465c07ce
7 changed files with 68 additions and 39 deletions

View File

@@ -64,9 +64,9 @@ void definition_data::insert_constructors() const {
type_ptr return_type(return_app);
for(auto& var : vars) {
if(var_set.find(var) != var_set.end())
throw std::runtime_error(
throw compiler_error(
std::string("type variable ") +
var + std::string(" used twice in data type definition."));
var + std::string(" used twice in data type definition."), loc);
var_set.insert(var);
return_app->arguments.push_back(type_ptr(new type_var(var)));
}