I should also note that the problem is related to the :outer somehow, because if we remove :outer from the definition of 'foo' in x.pir then everything works as expected:
$ ./parrot y.pir
compiler start
reading x.pir into $S0
compiling (but not running) $S0
XYZ::BEGIN
done compiling
compiler end
$
Pm
