Commit f83f245c authored by Rob Pike's avatar Rob Pike

add another test to decl to see that result vars are redeclarable.

R=ken
OCL=27620
CL=27620
parent 7e1cfa74
...@@ -12,6 +12,11 @@ func f1() int { return 1 } ...@@ -12,6 +12,11 @@ func f1() int { return 1 }
func f2() (float, int) { return 1, 2 } func f2() (float, int) { return 1, 2 }
func f3() (float, int, string) { return 1, 2, "3" } func f3() (float, int, string) { return 1, 2, "3" }
func x() (s string) {
a, b, s := f3();
return // tests that result var is in scope for redeclaration
}
func main() { func main() {
i, f, s := f3(); i, f, s := f3();
j, f := f2(); // redeclare f j, f := f2(); // redeclare f
...@@ -26,4 +31,7 @@ func main() { ...@@ -26,4 +31,7 @@ func main() {
m, g, s := f3(); m, g, s := f3();
m, h, s := f3(); m, h, s := f3();
} }
if x() != "3" {
println("g() failed");
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment