[Issue 3557] Pure function cannot call struct constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jan 10 11:54:45 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3557


Don <clugdbug at yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|                            |clugdbug at yahoo.com.au


--- Comment #1 from Don <clugdbug at yahoo.com.au> 2010-01-10 11:54:44 PST ---
It shouldn't compile, since the constructor isn't marked as pure. But if you
mark the constructor as pure:

 pure {
     this (float f) {
        this.f = f;
    }
 }

you get:
bug.d(14): Error: cannot modify const/immutable/inout expression this.f

So we definitely have a problem.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list