https://issues.dlang.org/show_bug.cgi?id=18563
Timoses <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Timoses <[email protected]> --- Related: https://forum.dlang.org/post/[email protected] // dmd v2.081.1 unittest { struct S { uint value; ~this() pure { } } S makeS() pure { S s = S(); return s; } // Error: cannot implicitly convert expression makeS() of type S to immutable(S) immutable S s = makeS(); } Without the destructor compiles fine. Perhaps a better error message could be found. Further related issue: https://issues.dlang.org/show_bug.cgi?id=18567 --
