[Issue 13692] New: alias this and is-expression anomaly

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Nov 6 02:11:03 PST 2014


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

          Issue ID: 13692
           Summary: alias this and is-expression anomaly
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: peter.alexander.au at gmail.com

-----------------------------------------------
struct T {
  int[] x;
  alias x this;
}

pragma(msg, is(T == int[]));   // false
pragma(msg, is(T == U[], U));  // true (!)
-----------------------------------------------

I would expect both to be false, as the IsExpression with == is supposed to
test for type equivalence, not implicit conversions.

--


More information about the Digitalmars-d-bugs mailing list