[Issue 13628] Error: immutable method S.~this is not callable using a mutable object and vice versa

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Jun 11 13:47:00 PDT 2015


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

Maxim Fomin <maxim-fomin at outlook.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|INVALID                     |---
           Severity|major                       |normal

--- Comment #4 from Maxim Fomin <maxim-fomin at outlook.com> ---
A) It does not call opposite dtor. It tries to call mutable dtor for mutable
object. In other words, it tries to pass immutable object as argument for
mutable lvalue parameter. It cannot work.

B) Then it means that currently there is no way to define two dtors which
differ by this pointer qualifier. So, it is another problem with D type system.
I think it should be possible to do, and compiler should select proper
overload. 

C) Basically it is same as b.

I suggest to reopen as request to fix b.

--


More information about the Digitalmars-d-bugs mailing list