D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 19964 - [Regression 2.066 - 2.067.1] nested pure functions variable access
Summary: [Regression 2.066 - 2.067.1] nested pure functions variable access
Status: RESOLVED DUPLICATE of issue 19963
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-14 10:47 UTC by Nicholas Wilson
Modified: 2019-06-14 11:28 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Nicholas Wilson 2019-06-14 10:47:08 UTC
From the source code of DMD no less!

void f() {
  int fx;
  pure void g() {
    int gx;
    /+pure+/ void h() {
      int hx;
      /+pure+/ void i() { fx = 0; }
    }
   }
}

should give 

Error: pure nested function 'g' cannot access mutable data 'fx'
if the commented out `purees are removed it should give 

Error: pure nested function 'i' cannot access mutable data 'fx'

three times.
Comment 1 Nicholas Wilson 2019-06-14 11:28:43 UTC

*** This issue has been marked as a duplicate of issue 19963 ***