2013/1/25 Adam Wilson <[email protected]> > On Thu, 24 Jan 2013 17:15:09 -0800, kenji hara <[email protected]> > wrote: > >> >> 1. Optional parentheses for normal functions should work shallowly IMO. >> 2. Optional parentheses for property functions should not work. Applying >> () >> for property function name always applied to its returned value. >> >> #1 is a ratification of current behavior. It allows the combination of >> UFCS >> and removing redundant ()s. >> #2 is a breaking change. If we need it, community consent is required. >> >> Kenji Hara >> > > I can completely agree with this change. It is perfectly workable to fix > properties without changing optional parens. I just won't use them :-P
I have thought an additional idea. If we really want a feature to disable optional parentheses for normal functions, we can add @function attribute to the language spec. int foo(); @property int bar(); @function int baz(); // new! int x1 = foo(); // ok int x2 = foo; // optional parentheses, allowed int y1 = bar(); // disallowed, calling int is meaningless int y2 = bar; // ok int z1 = baz(); // ok int z2 = baz; // *disallowed* by @function attribute How about? Kenji Hara
