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:
+4
-4
@@ -13,11 +13,11 @@ package ExplorerTest api;
|
||||
|
||||
// TODO: Implement this with some kind of reflection?
|
||||
external impl {.x: i32, .y: i32} as EqWith(Self) {
|
||||
fn Equal[me: Self](other: Self) -> bool {
|
||||
return me.x == other.x and me.y == other.y;
|
||||
fn Equal[self: Self](other: Self) -> bool {
|
||||
return self.x == other.x and self.y == other.y;
|
||||
}
|
||||
fn NotEqual[me: Self](other: Self) -> bool {
|
||||
return me.x != other.x or me.y != other.y;
|
||||
fn NotEqual[self: Self](other: Self) -> bool {
|
||||
return self.x != other.x or self.y != other.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -11,11 +11,11 @@ package ExplorerTest api;
|
||||
|
||||
// TODO: Implement this with some kind of reflection?
|
||||
external impl {.x: i32, .y: i32} as EqWith(Self) {
|
||||
fn Equal[me: Self](other: Self) -> bool {
|
||||
return me.x == other.x and me.y == other.y;
|
||||
fn Equal[self: Self](other: Self) -> bool {
|
||||
return self.x == other.x and self.y == other.y;
|
||||
}
|
||||
fn NotEqual[me: Self](other: Self) -> bool {
|
||||
return me.x != other.x or me.y != other.y;
|
||||
fn NotEqual[self: Self](other: Self) -> bool {
|
||||
return self.x != other.x or self.y != other.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -10,11 +10,11 @@ package ExplorerTest api;
|
||||
|
||||
// TODO: Implement this with some kind of reflection?
|
||||
external impl {.x: i32, .y: i32} as EqWith(Self) {
|
||||
fn Equal[me: Self](other: Self) -> bool {
|
||||
return me.x == other.x and me.y == other.y;
|
||||
fn Equal[self: Self](other: Self) -> bool {
|
||||
return self.x == other.x and self.y == other.y;
|
||||
}
|
||||
fn NotEqual[me: Self](other: Self) -> bool {
|
||||
return me.x != other.x or me.y != other.y;
|
||||
fn NotEqual[self: Self](other: Self) -> bool {
|
||||
return self.x != other.x or self.y != other.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ package ExplorerTest api;
|
||||
|
||||
class TypeLike {
|
||||
impl as ImplicitAs(Type) {
|
||||
fn Convert[me: Self]() -> Type { return i32; }
|
||||
fn Convert[self: Self]() -> Type { return i32; }
|
||||
}
|
||||
fn Make() -> Self { return {}; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user