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
+3 -3
View File
@@ -13,16 +13,16 @@
package ExplorerTest api;
interface Addable {
fn Add[me: Self](k: i32) -> Self;
fn Add[self: Self](k: i32) -> Self;
}
impl i32 as Addable {
fn Add[me: Self](k: i32) -> Self { return me + k; }
fn Add[self: Self](k: i32) -> Self { return self + k; }
}
class Class { var n: i32; }
class GenericClass(T:! Addable) {
var m: T;
fn Get[me: Self](n: i32) -> T { return me.m.Add(n); }
fn Get[self: Self](n: i32) -> T { return self.m.Add(n); }
}
alias ClassAlias = Class;
+4 -4
View File
@@ -11,19 +11,19 @@ package ExplorerTest api;
interface I {
fn F() -> i32;
fn M[me: Self]() -> i32;
fn M[self: Self]() -> i32;
}
class A {
var n: i32;
impl as I {
fn F() -> i32 { return 1; }
fn M[me: Self]() -> i32 { return 2; }
fn M[self: Self]() -> i32 { return 2; }
}
fn G[me: Self]() -> i32 { return 3; }
fn G[self: Self]() -> i32 { return 3; }
}
impl i32 as I {
fn F() -> i32 { return 4; }
fn M[me: Self]() -> i32 { return 5; }
fn M[self: Self]() -> i32 { return 5; }
}
alias IF = I.F;