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
An incorrect number of values can be assigned to a set of variables without triggering an error. The following code, which should produce a compilation error, works in Gnolang and returns incorrect output:
package main
import"fmt"funcmain() {
a, c:=1, 2, 3fmt.Println(a, c)
}
Expected Behavior:
The code should result in an error stating:
assignment mismatch: 2 variables but 3 values
Actual Behavior:
the code compiles and runs, producing the output:
2 3
The text was updated successfully, but these errors were encountered:
Description:
Issue Summary:
An incorrect number of values can be assigned to a set of variables without triggering an error. The following code, which should produce a compilation error, works in Gnolang and returns incorrect output:
Expected Behavior:
The code should result in an error stating:
Actual Behavior:
the code compiles and runs, producing the output:
The text was updated successfully, but these errors were encountered: