I originally posted some of this as a question about how lookup was supposed to work , but now I can see it's not just unexpected behavior, it's actually buggy.
function foo() as Number {
return 0;
}
module bar {
module foo {
module bar {...