Implement rename me -> self (#2444)

Implements change proposed in #1382

Replaces #1624
This commit is contained in:
josh11b
2022-12-06 20:17:00 -08:00
committed by GitHub
parent d1210c4a50
commit 9c8fd6864e
287 changed files with 1727 additions and 1720 deletions
+4 -4
View File
@@ -872,7 +872,7 @@ auto Interpreter::CallDestructor(Nonnull<const DestructorDeclaration*> fun,
BindingMap generic_args;
// TODO: move this logic into PatternMatch, and call it here.
auto p = &method.me_pattern().value();
auto p = &method.self_pattern().value();
const auto& placeholder = cast<BindingPlaceholderValue>(*p);
if (placeholder.value_node().has_value()) {
method_scope.Bind(*placeholder.value_node(), receiver);
@@ -953,8 +953,8 @@ auto Interpreter::CallFunction(const CallExpression& call,
call.source_loc()));
RuntimeScope method_scope(&heap_);
BindingMap generic_args;
// Bind the receiver to the `me` parameter.
auto p = &method.me_pattern().value();
// Bind the receiver to the `self` parameter.
auto p = &method.self_pattern().value();
if (p->kind() == Value::Kind::BindingPlaceholderValue) {
// TODO: move this logic into PatternMatch
const auto& placeholder = cast<BindingPlaceholderValue>(*p);
@@ -962,7 +962,7 @@ auto Interpreter::CallFunction(const CallExpression& call,
method_scope.Bind(*placeholder.value_node(), m.receiver());
}
} else {
CARBON_CHECK(PatternMatch(&method.me_pattern().value(), m.receiver(),
CARBON_CHECK(PatternMatch(&method.self_pattern().value(), m.receiver(),
call.source_loc(), &method_scope,
generic_args, trace_stream_, this->arena_));
}