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.
21 lines
290 B
Plaintext
21 lines
290 B
Plaintext
class Foo {
|
|
bar = value {
|
|
IO.print("setter")
|
|
return value
|
|
}
|
|
|
|
test {
|
|
bar = "value" // expect: setter
|
|
|
|
{
|
|
bar = "value" // expect: setter
|
|
var bar = "local"
|
|
bar = "value" // no expectation
|
|
}
|
|
|
|
bar = "value" // expect: setter
|
|
}
|
|
}
|
|
|
|
(new Foo).test
|