[Issue 17578] Propagate the common qualifier of fields to the containing type

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Jun 30 16:19:47 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17578

Jonathan M Davis <issues.dlang at jmdavisProg.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |issues.dlang at jmdavisProg.co
                   |                            |m

--- Comment #1 from Jonathan M Davis <issues.dlang at jmdavisProg.com> ---
This seems reasonable, though I expect that it would be of limited usefulness.
Certanily, I normally recommend to people that they not make any members in a
struct const or immutable if they can help it, because it gets in the way of
basic operations like copying and assignment (e.g. not being able to assign to
a mutable struct is the sort of thing that causes confusion, but that's exactly
what happens when you have a const member variable). So, I doubt that this
change would affect much, but I see no conceptual reason why it would be a
problem, and given that you've created this enhancement, I expect that you've
found at least one use case where it makes sense.

--


More information about the Digitalmars-d-bugs mailing list