Problem with Point property

Henning Hasemann hhasemann at web.de
Tue Mar 6 13:50:19 PST 2007


> >
> > Foo().position.x = 5;
> >
> 
> This should be easy enough for the compiler to detect and automatically  
> call the matching setter (if none, error). But the compiler doesn't even  
> detect some basic operators on properties, so...

A first test lets me think, the compiler reads this as:

Point tmp = (new Foo()).position;
tmp.x = 5;

speak: The position is copied from the object and the assignment is made
on the copy.

Henning

-- 
v4sw7Yhw4ln0pr7Ock2/3ma7uLw5Xm0l6/7DGKi2e6t6ELNSTVXb7AHIMOen5a2Xs5Mr2g5ACPR hackerkey.com



More information about the Digitalmars-d mailing list