Switch executable semantics to use ErrorBuilder directly and relocate macros (#1184)

This commit is contained in:
Jon Meow
2022-04-13 09:05:21 -07:00
committed by GitHub
parent 6542506cdc
commit 87e58f5db3
37 changed files with 327 additions and 376 deletions
@@ -167,8 +167,7 @@ static auto ResolveNames(Expression& expression,
case ExpressionKind::TypeTypeLiteral:
break;
case ExpressionKind::UnimplementedExpression:
return FATAL_COMPILATION_ERROR(expression.source_loc())
<< "Unimplemented";
return CompilationError(expression.source_loc()) << "Unimplemented";
}
return Success();
}
@@ -376,7 +375,7 @@ static auto ResolveNames(Declaration& declaration, StaticScope& enclosing_scope)
RETURN_IF_ERROR(
ResolveNames(alternative->signature(), enclosing_scope));
if (!alternative_names.insert(alternative->name()).second) {
return FATAL_COMPILATION_ERROR(alternative->source_loc())
return CompilationError(alternative->source_loc())
<< "Duplicate name `" << alternative->name()
<< "` in choice type";
}