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:
@@ -50,14 +50,14 @@ constraint WidgetC {
|
||||
}
|
||||
|
||||
abstract class Abstract {
|
||||
abstract fn DoSomething[me: Self]();
|
||||
abstract fn DoSomething[self: Self]();
|
||||
}
|
||||
|
||||
base class Widget {
|
||||
virtual fn Print[addr me: Self*](var i: i64, x: f32 = 4.2, _: bool);
|
||||
virtual fn Print[addr self: Self*](var i: i64, x: f32 = 4.2, _: bool);
|
||||
}
|
||||
|
||||
fn Widget.Print[addr me: Self*](var i: i64, x: f32, _: bool, 47) {
|
||||
fn Widget.Print[addr self: Self*](var i: i64, x: f32, _: bool, 47) {
|
||||
Carbon.Print("test" + "t\u{FFFF}his");
|
||||
Carbon.Print(
|
||||
"""
|
||||
@@ -72,14 +72,14 @@ fn Widget.Print[addr me: Self*](var i: i64, x: f32, _: bool, 47) {
|
||||
}
|
||||
|
||||
class FancyWidget(T:! Type) extends Widget {
|
||||
impl fn Print[me: Self]();
|
||||
impl fn Print[self: Self]();
|
||||
|
||||
impl as Add(T) {
|
||||
fn Op[me: Self]();
|
||||
fn Op[self: Self]();
|
||||
}
|
||||
}
|
||||
|
||||
fn FancyWidget(T:! Type).Print[me: Self]() {
|
||||
fn FancyWidget(T:! Type).Print[self: Self]() {
|
||||
Carbon.Print("more test");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user