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

--- Comment #0 from Tomasz SowiƄski <> 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:
------- You are receiving this mail because: -------

Reply via email to