The assignment operator cannot be overloaded for rvalues that can be implicitly cast to the lvalue type. Doing so results in a compiler error. But doing it via an alias, the compiler does not complain. class C{ C set( C c ){ return c; } alias set opAssign; } --