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
@@ -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
View File
@@ -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
View File
@@ -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;
}
}
+1 -1
View File
@@ -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 {}; }
}