http://d.puremagic.com/issues/show_bug.cgi?id=4291
Summary: Pure functions cannot access mixed in variables
Product: D
Version: 2.041
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Shin Fujishiro <[email protected]> 2010-06-07 02:40:13 PDT
---
DMD raises a compiler error when a mixed in variable is used in a pure
function.
--------------------
void test() pure
{
mixin declareVariable;
var = 42; // Error: pure nested function 'test' cannot access
// mutable data 'var'
}
template declareVariable() { int var; }
--------------------
The mixed-in variable var should be treated as if it's directly declared in
test()'s scope. So the above code should be correct and accepted.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------