mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 21:58:11 +00:00
Switch executable semantics to use ErrorBuilder directly and relocate macros (#1184)
This commit is contained in:
1 parent
6542506cdc
commit
87e58f5db3
37 files changed
+327
-376
No files matched your search
@@ -9,7 +9,7 @@
|
||||
#include "common/ostream.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 "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Support/Casting.h"
|
||||
|
||||
@@ -151,7 +151,7 @@ auto TuplePatternFromParenContents(Nonnull<Arena*> arena,
|
||||
auto AlternativePattern::RequireFieldAccess(Nonnull<Expression*> alternative)
|
||||
-> ErrorOr<Nonnull<FieldAccessExpression*>> {
|
||||
if (alternative->kind() != ExpressionKind::FieldAccessExpression) {
|
||||
return FATAL_PROGRAM_ERROR(alternative->source_loc())
|
||||
return ProgramError(alternative->source_loc())
|
||||
<< "Alternative pattern must have the form of a field access.";
|
||||
}
|
||||
return &cast<FieldAccessExpression>(*alternative);
|
||||
|
||||
Reference in new issue
Block a user