]> Cypherpunks repositories - gostls13.git/commitdiff
Extend fixedbugs/bug143.go with function return values,
authorDavid Symonds <dsymonds@golang.org>
Wed, 22 Apr 2009 03:26:26 +0000 (20:26 -0700)
committerDavid Symonds <dsymonds@golang.org>
Wed, 22 Apr 2009 03:26:26 +0000 (20:26 -0700)
as a regression test for the fix made in s2/27706.

R=r
APPROVED=r
DELTA=14  (13 added, 0 deleted, 1 changed)
OCL=27707
CL=27709

test/fixedbugs/bug143.go

index 07f3cdc5446b0e69540539d288e85d4bf600745c..f6001376a100814eee6ea022d47b34f6f5bb746a 100644 (file)
@@ -8,12 +8,17 @@ package main
 
 type myMap map[string] int;
 
+func f() *myMap {
+       m := make(map[string] int);
+       return &m
+}
+
 func main() {
        m := make(myMap);
        mp := &m;
 
        {
-               x, ok := m["key"];
+               x, ok := m["key"]
        }
        {
                x, ok := (*mp)["key"]
@@ -21,6 +26,14 @@ func main() {
        {
                x, ok := mp["key"]
        }
+       {
+               x, ok := f()["key"]
+       }
+       {
+               var x int;
+               var ok bool;
+               x, ok = f()["key"]
+       }
 }
 
 /*