The assignment type-checking code previously bounced around a lot
between the LHS and RHS sides of the assignment. But there's actually
a very simple, consistent pattern to how to type check assignments:
1. Check the RHS expression.
2. If the LHS expression is an identifier that was declared in this
statement and it doesn't have an explicit type, give it the RHS
expression's default type.
3. Check the LHS expression.
4. Try assigning the RHS expression to the LHS expression, adding
implicit conversions as needed.
This CL implements this algorithm, and refactors tcAssign and
tcAssignList to use a common implementation. It also fixes the error
messages to consistently say just "1 variable" or "1 value", rather
than occasionally "1 variables" or "1 values".
Passes toolstash -cmp.
Trust: Matthew Dempsky <email@example.com>
Run-TryBot: Matthew Dempsky <firstname.lastname@example.org>
TryBot-Result: Go Bot <email@example.com>
Reviewed-by: Cuong Manh Le <firstname.lastname@example.org>