www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22515] New: Aggregate definition with qualifiers has

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

          Issue ID: 22515
           Summary: Aggregate definition with qualifiers has
                    inconsistencies between structs and classes
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: boris2.9 gmail.com

code:

const struct S { }
S s;
static assert(is(S == const));
static assert(is(typeof(s) == const));

const class C { }
C c;
static assert(is(C == const));         // fails
static assert(is(typeof(c) == const)); // fails

--
Nov 16 2021