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
the following code causes the compiler to give the
message: "error in shape across RETURN"
package test
func x() (a int, b string) {
defer func(){
a++
}()
return y()
}
func y() (int, string) {
return 0, ""
}
8g darwin 386 443fb42ed60e+ tip
The text was updated successfully, but these errors were encountered:
When I changed a++ to refer to a local variable x instead of a parameter, there was no
compiler error.
package test
func x() (a int, b string) {
var x int
defer func() {
x++
}()
return y()
}
func y() (int, string) {
return 0, ""
}
The text was updated successfully, but these errors were encountered: