summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/fixedbugs/bug143.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/fixedbugs/bug143.go b/test/fixedbugs/bug143.go
index 07f3cdc54..f6001376a 100644
--- a/test/fixedbugs/bug143.go
+++ b/test/fixedbugs/bug143.go
@@ -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"]
+ }
}
/*