[Issue 1885] New: Syntax error for object identity test between invariant/mutable references

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 2 07:03:19 PST 2008


http://d.puremagic.com/issues/show_bug.cgi?id=1885

           Summary: Syntax error for object identity test between
                    invariant/mutable references
           Product: D
           Version: 2.011
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: ludwig at informatik.uni-luebeck.de


Checking for object identity using 'a is b' causes a syntax error, if one of a
and b is of type invariant(C) and the other one is typed C - although this
should be allowed.


-----------------
class C {}
struct S {}

int main(){
        invariant(S)* si;
        S* sm;
        // Works:
        bool a = si is sm;

        invariant(C) ci;
        const(C) cm;
        // Error: incompatible types for ((ci) is (cm)): 'invariant(C)' and
'bug_is.C'
        bool b = ci is cm;

        return 0;
}
-----------------


-- 



More information about the Digitalmars-d-bugs mailing list