www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17864] New: POD struct not equivalent to primitive type in

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 puremagic.com
          Reporter: dfj1esp02 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?

--
Sep 28 2017