A co třeba se inspirovat u konkurence? Když se konkurence mohla inspirovat od Javy
void Correct()
{
var v = new List<string>();
v.Add("Test");
}
==> O.K.
void Incorrect(bool b)
{
var v;
if (b)
v = new List<string>();
else
v = new HashSet<string>();
v.Add("Test");
}
==> Error CS0818: An implicitly typed local variable declarator must include an initializer