http://d.puremagic.com/issues/show_bug.cgi?id=10506
Summary: Purity should not be checked in a mixin statement
Product: D
Version: D2
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 Andrej Mitrovic <[email protected]> 2013-06-29
12:59:23 PDT ---
-----
import std.string;
void test() pure
{
mixin(["foo", "bar"].join());
}
void main() {}
-----
> test.d(5): Error: pure function 'test.test' cannot call impure function
> 'std.array.join!(string[]).join'
> test.d(5): Error: found 'EOF' when expecting ';' following statement
> test.d(5): Error: undefined identifier foobar
I think the above should be allowed. I can't think of a case where the code
which *produces* the string to be mixed in can somehow affect the purity of the
function the mixin statement is in.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------