local:: doesn't work on variables
Imported from http://bugzilla.roxen.com/bugzilla/show_bug.cgi?id=1256
Reported by Martin Stjernholm mast@roxen.com
The following program prints 19 and not 17, as I'd expect:
class A
{
int i = 17;
int foo() {return local::i;}
}
class B
{
inherit A;
int i = 19;
}
int main()
{
werror ("%d\n", B()->foo());
}
If the declaration for i in A is made local instead of using local::i, it works. Seems like there must be an extra variable slot allocated in B whenever there's any local:: reference in A. If this is tricky to solve, I think it should be a compile time error to use local:: for variables.