https://issues.dlang.org/show_bug.cgi?id=18563

Timoses <timos...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timos...@gmail.com

--- Comment #1 from Timoses <timos...@gmail.com> ---
Related: https://forum.dlang.org/post/rxolioihwfrljpfjf...@forum.dlang.org

// 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

--

Reply via email to