If I create a module X.pmod with the contents
class Y { class X { } }
and then tries to run the following program
class Z { inherit X.Y; }
void main() { }
I will get the error that 'Index Y not present in module "X".' Doing other things with X.Y is however possible, like declaring a variable "X.Y foo;" in the Z class or making the statement werror("%O\n", indices(X.Y)); in main().
If I create a module X.pmod with the contents
and then tries to run the following program
I will get the error that 'Index Y not present in module "X".' Doing other things with X.Y is however possible, like declaring a variable "X.Y foo;" in the Z class or making the statement werror("%O\n", indices(X.Y)); in main().
Works fine for me:
$ cat >lyslyskom16472935.pmod class Y { class X { } } $ cat >lyslyskom16472935bug.pike class Z { inherit .lyslyskom16472935.Y; }
void main() { } $ ./pike -mmaster.pike lyslyskom16472935bug.pike $
Ah, I forgot to mention the important thing. class X must have the same name as the module X. Change either and it will work.
The problem is probably that "X" will refer to ".X.Y.X" in pass two, since the namespace .X.Y has been inherited. And then it is correct that X.Y does not exist, because there is no .X.Y.X.Y.
Then it is better to redesign the API of the module than forcing people to use the global.-stuff...
pike-devel@lists.lysator.liu.se