www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18310] New: __traits(isDisabled) returns true for


          Issue ID: 18310
           Summary: __traits(isDisabled) returns true for non-function
                    struct member annotated with  disable
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: hsteoh quickfur.ath.cx

struct S {
     disable string toString();
static assert(__traits(isDisabled, S.toString)); // OK

struct T {
     disable float toString;
static assert(__traits(isDisabled, T.toString)); // NG

Expected behaviour: either annotating a non-function member with  disable
should be rejected with a compile error, or __traits(isDisabled) should return
true in that case.

Jan 26 2018