[Issue 11108] `hasElaborateAssign` should check whether the type is assignable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 12 05:44:16 PDT 2013


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



--- Comment #7 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-10-12 16:44:14 MSD ---
(In reply to comment #5)
> I don't believe this is a good choice.
> 
> I think a trait can be used inside a runtime check, and as such, all traits
> should always compile.
> 
> This is currently the case for every trait we have, be they in std.traits or
> std.range.
> 
> The trait name is "hasElaborateAssign". It should really just answer yes/no.
> Not yes, no, error.

See
https://github.com/D-Programming-Language/phobos/pull/1623#issuecomment-26196738
for reply:
> So, we are talking about this:
>
> if (isAssignable!SS && !hasElaborateAssign!SS)
>
> Even in the case it would be just rare and uncommon code it is silly to make regular code error-prone (spending programmers time on debugging their mistakes) to support some patterns almost nobody use. But we are talking here about not just rare and uncommon, but almost definitely incorrect construction indicating an error. And you really did the error here [see pull discussion] which my pull shown.

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