[Issue 2736] New: ref returns from 'properties' can't be the LHS of augmentation assignment

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 15 10:18:16 PDT 2009


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

           Summary: ref returns from 'properties' can't be the LHS of
                    augmentation assignment
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jarrett.billingsley at gmail.com


struct S
{
    int mX;

    ref int x()
    {
        return mX;
    }
}

void main()
{
    S s;
    s.x += 4; // line 20
}


foo.d(20): Error: 's.x' is not a scalar, it is a ref int()
foo.d(20): Error: incompatible types for ((s.x) += (4)): 'ref int()' and 'int'
foo.d(20): Error: 's.x' is not of arithmetic type, it is a ref int()


-- 



More information about the Digitalmars-d-bugs mailing list