I think it's just too iffy. When the two variables are the same type it's an easy specific case, but in the more general case you'd have to consider what is "correct" in code like:
var x = new object(), y = "Hello!", z = 5;
Should those all be typed as object
, since that's the only type they all have in common? Or should x
be object
, y
be string
, and z
be int
?
On the one hand you might think the former, since variables declared in this way (all on one line) are usually presumed to all be the same type. On the other hand perhaps you'd think it's the latter, since the var
keyword is typically supposed to get the compiler to infer the most specific type for you.
Better to just prohibit this altogether than bother working out exactly how it should behave, given that it would not exactly be a "killer" feature anyway.
That's my opinion/guess, at least.