Currently, localparam declarations inside generate blocks are elaborated after any nested generate constructs are elaborated. This prevents the localparams being used by the nested constructs. Reversing the elaboration order fixes this bug.
Attached are patches for devel and for v0.9, and a regression test for the test suite. The regression test doesn't need any special flags or a gold file.