mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Implement rename me -> self (#2444)
Implements change proposed in #1382 Replaces #1624
This commit is contained in:
@@ -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_));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user