Bug 11108 – `hasElaborateAssign` should check whether the type is assignable

Status
REOPENED
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-09-23T03:37:55Z
Last change time
2024-12-01T16:18:52Z
Assigned to
Denis Shelomovskii
Creator
Denis Shelomovskii
Moved to GitHub: phobos#10003 →

Comments

Comment #0 by verylonglogin.reg — 2013-09-23T03:37:55Z
The usage of `hasElaborateAssign` on unassignable types (e.g. `const` ones) which now results in returning `false` is almost definitely an error. So `hasElaborateAssign` has to reject such types.
Comment #1 by verylonglogin.reg — 2013-09-23T03:41:18Z
Comment #2 by github-bugzilla — 2013-10-08T21:51:00Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/76fcee3a6679b2348fad1e375c62b2c7c82d430e Fix Issue 11108 - `hasElaborateAssign` should check whether the type is assignable Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=11108 https://github.com/D-Programming-Language/phobos/commit/561d266f485646ced9c0449a7a64fa16563dd3a6 Merge pull request #1598 from denis-sh/fix-Issue-11108 Fix Issue 11108 - `hasElaborateAssign` should check whether the type is assignable
Comment #3 by github-bugzilla — 2013-10-08T23:30:39Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/396d629120a05ff65ba6d89997f99a8a00a9ef67 Revert "Fix Issue 11108 - `hasElaborateAssign` should check whether the type is assignable" This reverts commit e82724d740d223b52be2800eeec8d5ed4f673dfb. https://github.com/D-Programming-Language/phobos/commit/2f65b41d41328004f21e1047d85c055446d3285b Merge pull request #1621 from monarchdodra/undoHasElaborate Revert "Fix Issue 11108 - `hasElaborateAssign` should check whether the ...
Comment #4 by github-bugzilla — 2013-10-09T07:05:09Z
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/73fa0f036a366c381beb0e784a1b28eccfe99741 Merge pull request #1623 from denis-sh/fix-Issue-11108-again-fixup-pull-1598 Fix issue 11108 again (fixup pull #1598)
Comment #5 by monarchdodra — 2013-10-12T05:17:02Z
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.
Comment #6 by github-bugzilla — 2013-10-12T05:17:19Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/8751ccfb0c70b5f4166eb7707af983ccab460ab2 Revert "Fix for issue 11108" This reverts commit c930d8bd5e5246653a0300aac791b4c82b0466c5. https://github.com/D-Programming-Language/phobos/commit/d327f339aaf8b8d6a7ad6e62626355a0e5e0fdd3 Merge pull request #1628 from monarchdodra/revert11108 Revert "Fix for issue 11108"
Comment #7 by verylonglogin.reg — 2013-10-12T05:44:14Z
(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.
Comment #8 by robert.schadek — 2024-12-01T16:18:52Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/10003 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB