[Issue 19964] New: [Regression 2.066 - 2.067.1] nested pure functions variable access
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jun 14 10:47:08 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=19964
Issue ID: 19964
Summary: [Regression 2.066 - 2.067.1] nested pure functions
variable access
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: regression
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: iamthewilsonator at hotmail.com
>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.
--
More information about the Digitalmars-d-bugs
mailing list