mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 17:51:05 +01:00
Implement rename me -> self (#2444)
Implements change proposed in #1382 Replaces #1624
This commit is contained in:
+6
-6
@@ -11,8 +11,8 @@ package ExplorerTest api;
|
||||
|
||||
interface Vector {
|
||||
fn Zero() -> Self;
|
||||
fn Add[me: Self](b: Self) -> Self;
|
||||
fn Scale[me: Self](v: i32) -> Self;
|
||||
fn Add[self: Self](b: Self) -> Self;
|
||||
fn Scale[self: Self](v: i32) -> Self;
|
||||
}
|
||||
|
||||
class Point {
|
||||
@@ -22,11 +22,11 @@ class Point {
|
||||
fn Zero() -> Point {
|
||||
return {.x = 0, .y = 0};
|
||||
}
|
||||
fn Add[me: Point](b: Point) -> Point {
|
||||
return {.x = me.x + b.x, .y = me.y + b.y};
|
||||
fn Add[self: Point](b: Point) -> Point {
|
||||
return {.x = self.x + b.x, .y = self.y + b.y};
|
||||
}
|
||||
fn Scale[me: Point](v: i32) -> Point {
|
||||
return {.x = me.x * v, .y = me.y * v};
|
||||
fn Scale[self: Point](v: i32) -> Point {
|
||||
return {.x = self.x * v, .y = self.y * v};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user