Looks like something isn't visited before the generator is visited in processmethodbodies.
It works if you specify the return type of Test.Arr as "as (double)".
But another way to get the code to work is to add this (before the test class, not after):
This forces the module class to be before the Test class in the AST. So that might suggest one way to fix the problem - move the module class to the beginning of the AST in the introducemoduleclass step.