You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
funcmain() {
vara, b=1// prog.go:4:6: assignment mismatch: 2 variables but 1 valuesvarc, d=1, 2, 3// prog.go:5:6: extra expression in var declarationvare, f, g=1, 2// prog.go:6:6: missing expression in var declarationh, i, j:=1, 2// prog.go:7:10: assignment mismatch: 3 variables but 2 values
}
The two messages in the middle for “extra” and “missing” expressions don’t actually point to the offending expression that unbalances the assignment, making the message less useful. Moreover, a slight modification to the Lhs and Rhs results in the much more clear, “assignment mismatch” message. In my opinion, all of these declarations should result in the assignment mismatch error.
The text was updated successfully, but these errors were encountered:
Sent in a follow-up CL, but there's obviously no rush for 1.12.
andybons
added
NeedsFix
The path to resolution is known, but the work has not been done.
and removed
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
labels
Feb 7, 2019
Example runs on playground with go1.11.1.
https://play.golang.org/p/UoxPKcFBMCG
The two messages in the middle for “extra” and “missing” expressions don’t actually point to the offending expression that unbalances the assignment, making the message less useful. Moreover, a slight modification to the Lhs and Rhs results in the much more clear, “assignment mismatch” message. In my opinion, all of these declarations should result in the assignment mismatch error.
The text was updated successfully, but these errors were encountered: