www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7038] New: Type mismatch with const struct

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7038

           Summary: Type mismatch with const struct
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: zan77137 nifty.com



This code should be compiled:
------------------
A a;
const struct A { }
A b;

static assert(is(typeof(a) == typeof(b))); // Error: static assert  (is(A ==
const(A))) is false

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 30 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7038




From http://d-programming-language.org/struct.html

 Const and Invariant Structs
 
 A struct declaration can have a storage class of const, immutable or shared.
 It has an equivalent effect as declaring each member of the struct as const,
 immutable or shared.
Then the definition of const struct A {} should translated to: struct A { const: (members...) } But, instead, current dmd implementation does like follows: struct __S { int a; int b = 2; } alias const(__S) S; -------- But, the documentation also has some inconsistent. See bug 7180. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 28 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7038


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull



https://github.com/D-Programming-Language/dmd/pull/783

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 04 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7038




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/a1e33827c83f14004c4fd31ff665e6312ca59385
fix Issue 7038 - Type mismatch with const struct

https://github.com/D-Programming-Language/dmd/commit/2e523c415a54c7f344d18898a50e9f896e4b1a15


Issue 7038 - Type mismatch with const struct

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 04 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7038


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 04 2012