Postblit bug

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 17 06:40:36 PDT 2014


Am Fri, 17 Oct 2014 14:42:53 +0200
schrieb Marco Leise <Marco.Leise at gmx.de>:

> Am Fri, 17 Oct 2014 00:42:24 +0000
> schrieb "IgorStepanov" <wazar at mail.ru>:
> 
> OK, I've run into the same problem and there is no line
> number, just:
> 
> Error: immutable method Lib.Sys.File.File.~this is not callable using a mutable object
> Error: mutable method Lib.Sys.File.File.~this is not callable using a immutable object
> 
> haha! I should start from scratch.

Here is a reduced test case, that I wish I had before I
tried to make 1000 lines of code work with immutable:

struct B {
    ~this() { /* some cleanup */ }
}

struct C {
    immutable B b;
}

void main() {
    C(immutable B());
}

That's pretty much it. You cannot use compose a mutable struct
out of immutable ones with dtors.

-- 
Marco



More information about the Digitalmars-d mailing list