mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 22:02:37 +01:00
Switch executable semantics to use ErrorBuilder directly and relocate macros (#1184)
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
#include "executable_semantics/ast/declaration.h"
|
||||
#include "executable_semantics/ast/expression.h"
|
||||
#include "executable_semantics/common/arena.h"
|
||||
#include "executable_semantics/common/error.h"
|
||||
#include "executable_semantics/common/error_builders.h"
|
||||
#include "executable_semantics/interpreter/action.h"
|
||||
#include "executable_semantics/interpreter/action_stack.h"
|
||||
#include "executable_semantics/interpreter/stack.h"
|
||||
@@ -560,7 +560,7 @@ auto Interpreter::StepExp() -> ErrorOr<Success> {
|
||||
const auto& tuple = cast<TupleValue>(*act.results()[0]);
|
||||
int i = cast<IntValue>(*act.results()[1]).value();
|
||||
if (i < 0 || i >= static_cast<int>(tuple.elements().size())) {
|
||||
return FATAL_RUNTIME_ERROR_NO_LINE()
|
||||
return RuntimeError(exp.source_loc())
|
||||
<< "index " << i << " out of range in " << tuple;
|
||||
}
|
||||
return todo_.FinishAction(tuple.elements()[i]);
|
||||
@@ -813,7 +813,7 @@ auto Interpreter::StepExp() -> ErrorOr<Success> {
|
||||
}
|
||||
}
|
||||
default:
|
||||
return FATAL_RUNTIME_ERROR(exp.source_loc())
|
||||
return RuntimeError(exp.source_loc())
|
||||
<< "in call, expected a function, not " << *act.results()[0];
|
||||
}
|
||||
} else if (act.pos() == 3) {
|
||||
|
||||
Reference in New Issue
Block a user