diff options
author | Rob Pike <r@golang.org> | 2009-04-19 21:12:13 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2009-04-19 21:12:13 -0700 |
commit | f409ea92c8accbc1d5dd19d51b3073353a53efa7 (patch) | |
tree | 7baa43a8d010491f627e001ae169dc3091fd758a | |
parent | 90bffe62a9ceb5828e83b97b87db1cf52e87a9ee (diff) | |
download | golang-f409ea92c8accbc1d5dd19d51b3073353a53efa7.tar.gz |
add another test to decl to see that result vars are redeclarable.
R=ken
OCL=27620
CL=27620
-rw-r--r-- | test/decl.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/decl.go b/test/decl.go index 6229db9b1..596a6e5fc 100644 --- a/test/decl.go +++ b/test/decl.go @@ -12,6 +12,11 @@ func f1() int { return 1 } func f2() (float, int) { return 1, 2 } 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() { i, f, s := f3(); j, f := f2(); // redeclare f @@ -26,4 +31,7 @@ func main() { m, g, s := f3(); m, h, s := f3(); } + if x() != "3" { + println("g() failed"); + } } |