[Issue 10648] std.traits.isMutable is true for struct defined immutable

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jul 15 18:07:36 PDT 2013


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


Kenji Hara <k.hara.pg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


--- Comment #1 from Kenji Hara <k.hara.pg at gmail.com> 2013-07-15 18:07:35 PDT ---
(In reply to comment #0)
> With dmd 2.064alpha this code runs with no assert errors:
> 
> 
> import std.traits: isMutable;
> immutable struct Foo {}
> void main () {
>     static assert(isMutable!Foo);
> }
> 
> 
> 
> Issue found by JS:
> http://forum.dlang.org/thread/xjpfwfydzxxwqisvqudw@forum.dlang.org

It is not an issue. Because:

1. Qualified struct declaration and its behavior is properly documented.
 http://dlang.org/struct#ConstStruct

2. The struct name `Foo` always represent 'mutable type Foo'. And, isMutable
tests whether the type qualifier is mutable or not.

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