[Issue 13435] New: Strange error if struct is a class member and opAssign applied

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Sep 7 02:22:57 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13435

          Issue ID: 13435
           Summary: Strange error if struct is a class member and opAssign
                    applied
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: temtaime at gmail.com

import std.stdio;

struct S(T) {
    void opAssign(T[] arg) {}
}

class B {
    this(int[] d) {
        S!int c;
        //_a = d; // Error: cannot implicitly convert expression (d) of type
int[] to S!int
        c = d; // compiles OK
    }

    S!int _a;
}

void main() {
}

--


More information about the Digitalmars-d-bugs mailing list