Hello,

struct S {
    int value;
    void opAssign(int value) {
        this.value = value;
    }
}
unittest {
    S s1;
    s1 = 3;     // OK
    S s2 = 3;   // _build_  error
}
==>
Element.d(105): Error: cannot implicitly convert expression (3) of type int to S

Do I miss something? And why not a compile-time error?


Thank you,
Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com

Reply via email to