http://d.puremagic.com/issues/show_bug.cgi?id=3281
Summary: append returned struct to array: Internal error: ../ztc/cod1.c 168 Product: D Version: 2.031 Platform: Other OS/Version: Linux Status: NEW Keywords: ice-on-valid-code Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: peng2che...@yahoo.com import std.stdio; struct S {string s; this(string x){s=x;}} immutable(S) mkS(){ return S("mks hi"); } void main(char[][] args) { immutable(S) s = mkS(); immutable(S)[] ss; ss ~= S("plain hi"); ss ~= cast(immutable(S)) S("plain hi"); //ss ~= mkS(); // --> "Internal error: ../ztc/cod1.c 1684" writeln(s.s, ", ", ss[0].s); } I think (hope?) this is all valid code. I.e., ss ~= S("Hi"); //should be ok ss.length = ss.length + 1; ss[$-1] = S("plain hi"); //should fail to compile (as it indeed does) In any case there is an ICE. Error: ss[0] isn't mutable Error: ss[0] isn't mutable //ss[0] = S("fail"); --> Error: ss[0] isn't mutable -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------