[Issue 6169] New: [CTFE] pure functions cannot compute constants using functions not marked as pure
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 16 17:14:06 PDT 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6169
Summary: [CTFE] pure functions cannot compute constants using
functions not marked as pure
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: timon.gehr at gmx.ch
--- Comment #0 from timon.gehr at gmx.ch 2011-06-16 17:09:25 PDT ---
With DMD 2.053:
string impure(){return ";";}
void main() pure{
enum s = impure(); // fail (cannot call impure function 'impure')
mixin(impure()); // ditto
}
Removing the pure attribute from 'main' or adding it to 'impure' makes the code
pass.
This restriction is nonsensical and should be removed.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list