Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
$\begingroup$Closing as this is in the docs. Read ref/message/General/setps in the documentation center. It says Part assignments are implemented only for parts of the value of a symbol. . The x["foo"][[1]] is not a symbol so you cannot set it with =.$\endgroup$
You could access the subparts of the association via x["foo"][[1]], but you could also access it as x[["foo", 1]]. Knowing that, your increment statement should be written
x["foo"][[1]]
is not a symbol so you cannot set it with=
. $\endgroup$