aboutsummaryrefslogtreecommitdiff
path: root/test/parentype.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-02-18 10:07:46 -0800
committerRuss Cox <rsc@golang.org>2009-02-18 10:07:46 -0800
commitebc10db3e14facac2cb843e12486f1f2176727d9 (patch)
tree142b19182e464bc8811c91b8e93f4994ddb25d6f /test/parentype.go
parent6950491b4f0475f488a3a47b8d7771131cd2e8e7 (diff)
downloadgo-ebc10db3e14facac2cb843e12486f1f2176727d9.tar.gz
go-ebc10db3e14facac2cb843e12486f1f2176727d9.zip
allow parens to disambiguate types.
examples: chan <- (chan int) chan (<- chan int) (map[string]func())("a": main) R=ken OCL=25151 CL=25151
Diffstat (limited to 'test/parentype.go')
-rw-r--r--test/parentype.go17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/parentype.go b/test/parentype.go
new file mode 100644
index 0000000000..f163f55d61
--- /dev/null
+++ b/test/parentype.go
@@ -0,0 +1,17 @@
+// $G $D/$F.go
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+func f(interface{})
+func g() {}
+func main() {
+ f(map[string]string("a":"b","c":"d"));
+ f((map[string]string)("a":"b","c":"d"));
+ f((map[string]func())("a":g,"c":g));
+ f(make(chan(<-chan int)));
+ f(make(chan<-(chan int)));
+}