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.
Sorry I'm not sure what you mean. Are you saying that `foo1` should be accessible to the static variable `g`? If so, it's definitely incorrect. Consider:

```d
debug = emulatePurityViolation;
auto test() pure {
    static int g = 0;
    int x = 10;
    int foo() { return x; }
    int bar() {
        debug(emulatePurityViolation) { ++g; x = g; }
        return x;
    }
    return [&foo, &bar];
}
void main() {
    auto f = test();
    assert(f[0]() == 10);
    f[1]();
    assert(f[0]() == 1);
}
```

In above, the nested function `foo` should be treated as weak purity. It's the key issue of 9148. Right?
Then,
1. if `bar` is accessible to global data`g` and could be impure, it should not be accessible to the local state of pure function `x` not to violate purity of `foo`. 
2. if `bar` is accessible to local variable `x`, it should not be accessible to global data `g` to disallow modifying local state of pure functions depending on global state.

Clearly, `bar` should also be weak purity. Therefore from the rule 2, it cannot be accessible to `g`.