One downside is that this syntax can't be used in variable declarations, only in assignments. For example, in a language like Java which requires variables to be declared before they are used, the following line will give an error because
y isn't declared:
int x = y = 0;
Theoretically there could be a special case for this syntax, so that this statement would declare both
y as new variables; but this would be surprising since
y = 0 is a perfectly valid expression when
y already exists, so somebody could write the above expecting to assign to the existing variable
y, in which case they would not expect the statement to declare a new variable with the same name, shadowing it.
var x = y = 0;
But it doesn't do what the programmer really intended: it declares
x as a local variable, but assigns to
y globally, possibly overwriting an existing global variable of the same name.
It may be worth noting that this isn't a problem in Python, because Python uses separate
nonlocal declarations to determine whether a given name in this scope is a local variable or not. So
(x := (y := 0))
in Python (using assignment expressions) can't accidentally assign to a nonlocal variable
y. The same applies to multiple assignments like
x = y = 0, but in Python's syntax this is only allowed as a statement, not an expression.