www.digitalmars.com         C & C++   DMDScript  

D - bug? array concatenation and properties

reply "Carlos Santander B." <carlos8294 msn.com> writes:
This code:

struct A {
    char [] member;
    char [] property () { return member; }
    void property (char [] value) { member = value; }
}

int main() {
    A a;
    a.property = "hello ";
    a.property ~= "world!"; // here
}

produces: "Can only concatenate arrays".

-----------------------
Carlos Santander Bernal
Jan 28 2004
parent Manfred Nowak <svv1999 hotmail.com> writes:
Carlos Santander B. wrote:

[...]
     a.property ~= "world!"; // here
 produces: "Can only concatenate arrays".

RTFM: | Note: Properties currently cannot be the lvalue of an op=, ++, or | -- operator. So long.
Jan 28 2004