feat: make this the implicit receiver for method calls inside class bodies
In the compiler, when a bare name is encountered inside a class definition and it does not resolve to a local variable or global, emit an implicit `this.` load before the call, enabling getter, setter, and method calls without explicit receiver. Update all benchmark, builtin, and test files to remove redundant `this.` qualifiers, and add comprehensive test suites for implicit receiver behavior across instance, inherited, static, nested, and shadowing scenarios.
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
||||
class List {
|
||||
toString {
|
||||
var result = "["
|
||||
for (i in 0...this.count) {
|
||||
for (i in 0...count) {
|
||||
if (i > 0) result = result + ", "
|
||||
result = result + this[i].toString
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user