The second syntax was shown to be impracticable by Tigran and Hilgart.
Check out the first syntax:
var rgb = (1.0f, 1.0f, 1.0f);
What happens if you do not want to use the Tuple class because instead you want to use the MyTuple class (which may have the advantage of IEnumerable<object> , something very useful!)? Obviously, the syntax will not help. You would need to put the MyTuple class somewhere ...
MyTuple<float, float, float> rgb = (1.0f, 1.0f, 1.0f);
or
var rgb = new MyTuple<float, float, float>(1.0f, 1.0f, 1.0f);
now the advantage of this new shorthand syntax is no longer because somewhere you should put MyTuple<float, float, float> .
Note that there is no collection initializer that simply "automatically detects" everything.
var myVar = new List<int> { 1, 2, 3 };
Here the fact that we are talking about a List<int> is perfectly clear :-)
Even an array initializer that is a bit "special" is not implicit ...
int[] myVar = { 1, 2, 3 }; var myVar = new[] { 1, 2, 3 }; var myVar = new int[] { 1, 2, 3 };
all are valid, but the fact that we're talking about an array is always explicit (there is always [] )
var myVar = { 1, 2, 3 };
invalid :-) And the array has an βadvantageβ as a primitive construct (arrays are supported directly by the IL language, and all other collections are built on top of other .NET libraries and / or arrays)