proposed syntax for tuple: t{} and TypeTuple: T{} (cf precedent of q{...})
ZombineDev via Digitalmars-d
digitalmars-d at puremagic.com
Tue Apr 5 10:34:51 PDT 2016
On Tuesday, 5 April 2016 at 16:34:49 UTC, jmh530 wrote:
> On Tuesday, 5 April 2016 at 15:29:06 UTC, ZombineDev wrote:
>> Action action = {}; // error: `{}` is an empty tuple, can't be
>> assigned to delegates
>> auto t = {}; // deduced as an empty tuple.
>> Also, the non-empty {} syntax can't be mistaken for a function
>> literal because non-empty function literals always have at
>> least one statement that ends with a semicolon.
>
> Is making this
> Action action = {};
> an error a breaking change? It currently compiles without error
> and I can get the typeof(action) as void delegate(), though I
> can't really do much of anything with it. Similarly for empty
> function literals.
Yes, I think it would be a breaking change, if my proposal is
accepted.
More information about the Digitalmars-d
mailing list