--- Comment #1 from Kenji Hara <> 2012-05-29 23:49:03 PDT ---
(In reply to comment #0)
> shouldn't compile, since empty is a property and therefore must not compile
> with parens per strict property enforcement as described in TDPL. _Not_ 
> calling
> popFront with parens _does_ result in an error with -property, but calling
> either of the property functions _with_ parens doesn't. So -property seems to
> be doing half of its job but not all of it. With -property, @property 
> functions
> should never be callable with parens, and non-@property functions should never
> be callable without them.

I can agree in basic, but I know a case which the strict property enforcement
will cause problems. It is opDispatch.

void main() {
  S s;
  assert(s.prop == 10);   // s.prop is expected as property
  assert(s.func(1) == 2); // s.func is expected as member function
struct S {
  @property auto opDislatch(string name, A...)(A args) {
    static if (name == "prop" && A.length==0) return 10;
    static if (name == "func" && A.length==1) return args[0] * 2;

If strict property enforcement is implemented, S.opDispatch won't work anymore.
Because @property is not considered by overload resolution.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to