[Issue 6323] New: Regression(2.054) calling opAssign inside a struct initializer

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 15 07:51:49 PDT 2011


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

           Summary: Regression(2.054) calling opAssign inside a struct
                    initializer
           Product: D
           Version: D2
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: soywiz at gmail.com


--- Comment #0 from Carlos Ballesteros Velasco <soywiz at gmail.com> 2011-07-15 07:46:36 PDT ---
version = PROBLEM_ON_2054;

struct TT {
    int v;

    static TT opCall(int vv) {
        TT v = void;
        v.v = vv;
        return v;
    }

    this(int that) {
        version (PROBLEM_ON_2054) {
            opAssign(that);
        } else {
            v = that;
        }
    }

    void opAssign(int that) {
        v = that;
    }
}

struct Test {
    TT field = TT(1);
    static assert (Test.init.field.v == 1);
}

int main(string[] args) {
    return 0;
}

-- 
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