digitalmars.D.bugs - [Issue 6414] New: Possible problem with pure and const attribute
- d-bugmail puremagic.com (28/28) Jul 30 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6414
- d-bugmail puremagic.com (16/16) Jul 30 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6414
- d-bugmail puremagic.com (11/11) Aug 27 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6414
http://d.puremagic.com/issues/show_bug.cgi?id=6414 Summary: Possible problem with pure and const attribute Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc --- Comment #0 from bearophile_hugs eml.cc 2011-07-30 19:45:12 PDT --- Is this a bug? class Foo { const int x; pure void bar() in { int y = x; } body {} } void main() {} DMD 2.054 gives: temp.d(5): Error: pure nested function 'bar' cannot access mutable data 'x' But x isn't even mutable. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 30 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6414 kennytm gmail.com changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch CC| |kennytm gmail.com Platform|x86 |All OS/Version|Windows |All --- Comment #1 from kennytm gmail.com 2011-07-30 23:53:15 PDT --- I believe this is a rejects-valid. My pull request* to revert the unnecessarily strict purity check allows this. You could also just make `x` immutable instead of const. *: https://github.com/D-Programming-Language/dmd/pull/243 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 30 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6414 bearophile_hugs eml.cc changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #2 from bearophile_hugs eml.cc 2011-08-27 05:14:41 PDT --- The latest versions of 2.055 give no errors, so I close this bug report. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 27 2011