mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Implement rename me -> self (#2444)
Implements change proposed in #1382 Replaces #1624
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
package ExplorerTest api;
|
||||
|
||||
interface MyAddWith(T:! Type) {
|
||||
fn Op[me: Self](b: T) -> Self;
|
||||
fn Op[self: Self](b: T) -> Self;
|
||||
}
|
||||
|
||||
class Point {
|
||||
@@ -20,8 +20,8 @@ class Point {
|
||||
|
||||
// Allowed: `Self` means `Point` after `as`
|
||||
impl Point as MyAddWith(Self) {
|
||||
fn Op[me: Point](b: Point) -> Point {
|
||||
return {.x = me.x + b.x, .y = me.y + b.y};
|
||||
fn Op[self: Point](b: Point) -> Point {
|
||||
return {.x = self.x + b.x, .y = self.y + b.y};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user