[Issue 8161] -property should give an error for invalid property functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 29 23:37:04 PDT 2012


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



--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2012-05-29 23:38:53 PDT ---
(In reply to comment #2)
> > A @property function has two parameters is now allowed for UFCS property
> > setter.
> 
> > @property foo(T)(T obj, int val) { ... }
> > void main() {
> >    S s;
> >    s.foo = 1;  // translated to .foo(s, 1), it's valid.
> > }
> 
> Yeah, because that's a free function. It's valid to use it as a property, so it
> makes sense for it to compile with @property. The example that I gave with two
> arguments was a member function, which already has the invisible this
> parameter, so it won't work as a property.
> 
> The point is that any function which cannot be legally used as a property
> function should not compile when marked with @property and compiled with
> -property.

OK. I got an understanding.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list