Make "this" the implicit receiver!
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
class Foo {
|
||||
getClosure {
|
||||
return fn {
|
||||
return this.toString
|
||||
return toString
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
class Outer {
|
||||
method {
|
||||
IO.print(this.toString) // expect: Outer
|
||||
IO.print(this) // expect: Outer
|
||||
|
||||
fn {
|
||||
IO.print(this.toString) // expect: Outer
|
||||
IO.print(this) // expect: Outer
|
||||
|
||||
class Inner {
|
||||
method {
|
||||
IO.print(this.toString) // expect: Inner
|
||||
IO.print(this) // expect: Inner
|
||||
}
|
||||
toString { return "Inner" }
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ class Foo {
|
||||
return fn {
|
||||
return fn {
|
||||
return fn {
|
||||
return this.toString
|
||||
return toString
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user