On Wed, 23 Jan 2013 23:03:32 +0400 Dmitry Olshansky <[email protected]> wrote:
> 23-Jan-2013 22:57, Nick Sabalausky пишет: > > On Wed, 23 Jan 2013 19:40:02 +0100 > > "Adam D. Ruppe" <[email protected]> wrote: > > > >> On Wednesday, 23 January 2013 at 18:24:22 UTC, Johannes Pfau > >> wrote: > >>> This sounds OK, but you can still run into the callable issue > >>> if a normal function returns a callable. > >> > >> I don't think so because delegates require the parens to call > >> anyway, and so do opCall objects (without the parens, it is just > >> a reference to it). > >> > > > > So you want it to work like this?: > > > > void foo() {...} > > void delegate() {...} bar; > > > > foo; // call it > > This is a call, arguably bad style > > > bar; // don't call it > > compile-time error, as statement has no side-effects? > (and we have this kind of check even now) > > > int foo() {...} int delegate() {...} bar; auto x = foo; // call it auto y = bar; // don't call it
