Issue 9148 - 'pure' is broken

https://issues.dlang.org/show_bug.cgi?id=9148

A nested function inside `pure` function should also be typed as `pure`, and considered as weak purity function.
This looks good to me. Calling `g++` should definitely be illegal here. The test looks valid to me. I was going to suggest that you add another function to test which did the same thing but was explicitly marked `pure`, but it looks like you already have one. My one suggestion would be that maybe a brief comment indicating that the function is supposed to be inferred as `pure` rather than simply commenting out `pure` would be a good idea, because someone might make the mistake of thinking that `pure` was only intended to be commented out `temporarily` rather than it being intended to indicate that inference was being used. Maybe `/+ inferred as pure +/` instead?

Oh, and just a quick correction on your English.

> Are you saying that foo1 should be accessible to the static variable g?

is backwards. It's _g_ that would be accessible to foo1, because it's foo1 that's accessing g, not g that's accessing foo1. foo is accessible to bar if bar can access foo, not if foo can access bar.