mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 15:21:04 +01:00
Update IfExpression to follow AST conventions (#1167)
This commit is contained in:
@@ -888,12 +888,12 @@ auto Interpreter::StepExp() -> ErrorOr<Success> {
|
||||
const auto& if_expr = cast<IfExpression>(exp);
|
||||
if (act.pos() == 0) {
|
||||
return todo_.Spawn(
|
||||
std::make_unique<ExpressionAction>(if_expr.condition()));
|
||||
std::make_unique<ExpressionAction>(&if_expr.condition()));
|
||||
} else if (act.pos() == 1) {
|
||||
const auto& condition = cast<BoolValue>(*act.results()[0]);
|
||||
return todo_.Spawn(std::make_unique<ExpressionAction>(
|
||||
condition.value() ? if_expr.then_expression()
|
||||
: if_expr.else_expression()));
|
||||
condition.value() ? &if_expr.then_expression()
|
||||
: &if_expr.else_expression()));
|
||||
} else {
|
||||
return todo_.FinishAction(act.results()[1]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user