proposed syntax for tuple: t{} and TypeTuple: T{} (cf precedent of q{...})

jmh530 via Digitalmars-d digitalmars-d at puremagic.com
Tue Apr 5 09:34:49 PDT 2016


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.


More information about the Digitalmars-d mailing list