Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 6284: [Regression 2.054] 'pure' does not work with 'with' statement #233

Closed
wants to merge 1 commit into from
Closed

Conversation

kennytm
Copy link
Contributor

@kennytm kennytm commented Jul 11, 2011

Fixes bug 6284.

Actually this solves a more generic regression, where

Structure* s = ...;
auto b = s.a;

cannot be used in 'pure' function. Not sure if this is allowed or not, but I think it is correct, because

  1. There is no way to get a reference to some global variable from internal without refering it first, which the pure check can handle,
  2. Accessing and modifying members are already possible via methods,
  3. Even if this is restricted to __withSym, this can be worked-around using with(*s) { ... } anyway.

Actually this solves a more generic regression, where

    Structure* s = ...;
    auto b = s.a;

cannot be used in 'pure' function. Not sure if this is allowed or not, but I think it is correct, because

1. There is no way to get a reference to some global variable from internal without refering it first, which the 'pure' check can handle,
2. Accessing and modifying members are already possible via methods,
3. Even if this is restricted to `__withSym`, this can be worked-around using `with(*s) { ... }` anyway.
@kennytm
Copy link
Contributor Author

kennytm commented Jul 12, 2011

Closing as I have a more complete and organized solution that also solves bug 6293.

@kennytm kennytm closed this Jul 12, 2011
braddr pushed a commit to braddr/dmd that referenced this pull request Sep 15, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant