[Issue 17864] New: POD struct not equivalent to primitive type in comparison

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 28 10:49:26 UTC 2017


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

          Issue ID: 17864
           Summary: POD struct not equivalent to primitive type in
                    comparison
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dfj1esp02 at sneakemail.com

struct A { int a; }
void g()
{
    shared A a;
    A b;
    a=b; //converts
    assert(a==b); //fail
}
Error: incompatible types for ((a) is (b)): 'shared(A)' and 'A'

Works for immutable. Is it an oversight?

--


More information about the Digitalmars-d-bugs mailing list