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

           Summary: Can't call constructor on immutable/const struct
           Product: D
           Version: 2.036
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: tomeks...@gmail.com


--- Comment #0 from Tomasz SowiƄski <tomeks...@gmail.com> 2009-12-15 16:08:25 
PST ---
I have problems when using an explicit constructor with structs. It manifests
itself when creating a stack variable.

immutable struct Strukt {
    this(int pole) { this.pole = pole; }
    int pole;
}

void main() {
    auto nowy = new Strukt(6);  // OK
    auto s = Strukt(8);     // Error: constructor test.Strukt.this (int pole)
is not callable using argument types (int) immutable
}

Same story for const. Side note: If you take off immutable/const, it compiles.

Looks similar to Bug 2610.

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

Reply via email to