On Wednesday, 24 December 2014 at 16:19:16 UTC, Kagamin wrote:
Just make opDispatch accept zero or more arguments, when zero
arguments are passed, it works as a property, when more
arguments are passed, it works like a method call, no need for
@property.
That doesn't work with functions that take zero or one arguments:
obj.foo(); // still calls opDispatch, not the returned property
obj.foo(bar); // indistinguishable from obj.foo = bar
With the ref return getter, pretty much everything else works
right, but these two cases are still ambiguous.