This issue was originally filed by zundel@google.com
This is meant to exercise the scope rules of 10.28 for unqualified identifier lookup. Currently there is a discrepancy between frog & vm implementation. I believe this is a bug in the VM - I looked for as similar language test and couldn't find one.
class A {}
class B {}
A get foo() {
return new A();
}
class C {
B get foo() {
return new B();
}
testGetter() {
return foo; // lexically closest def is in this class.
}
}
class D extends C {
testGetter() {
return foo; // lookup rules in 10.28 favor top level scope over this.foo
}
}
main() {
var result;
result = new C().testGetter();
Expect.isTrue(result is B);
result = new D().testGetter();
Expect.isTrue(result is A); // vm fails here
}