www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21889] New: __traits(isSame, Object, const Object) yields true

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

          Issue ID: 21889
           Summary: __traits(isSame, Object, const Object) yields true
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andrei erdani.com

This code fails:

static assert(!__traits(isSame, Object, const Object));


The issue seems is not particular for Object and const Object. These fail too:

struct S {}
static assert(!__traits(isSame, S, const S));
class C {}
static assert(!__traits(isSame, C, const C));

Possibly related: https://issues.dlang.org/show_bug.cgi?id=20863

--
May 03