summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLuuk van Dijk <lvd@golang.org>2012-02-06 16:38:59 +0100
committerLuuk van Dijk <lvd@golang.org>2012-02-06 16:38:59 +0100
commit2d75c90fbab4856d0cae774f2e0ba624d47bca44 (patch)
treee10ca843068298dbf17fb3530806cc199e613e93 /test
parent1ce04f99c4b0cdcfe91a5e414abce8f32048dbe6 (diff)
downloadgo-2d75c90fbab4856d0cae774f2e0ba624d47bca44.tar.gz
cmd/gc: another special (%hhS) case for method names.
Fixes issue 2877 R=rsc CC=golang-dev http://codereview.appspot.com/5637047
Diffstat (limited to 'test')
-rw-r--r--test/fixedbugs/bug407.dir/one.go20
-rw-r--r--test/fixedbugs/bug407.dir/two.go15
-rw-r--r--test/fixedbugs/bug407.go7
3 files changed, 42 insertions, 0 deletions
diff --git a/test/fixedbugs/bug407.dir/one.go b/test/fixedbugs/bug407.dir/one.go
new file mode 100644
index 000000000..a91d90433
--- /dev/null
+++ b/test/fixedbugs/bug407.dir/one.go
@@ -0,0 +1,20 @@
+// Copyright 2012 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 one
+
+// Issue 2877
+type T struct {
+ f func(t *T, arg int)
+ g func(t T, arg int)
+}
+
+func (t *T) foo(arg int) {}
+func (t T) goo(arg int) {}
+
+func (t *T) F() { t.f = (*T).foo }
+func (t *T) G() { t.g = T.goo }
+
+
+
diff --git a/test/fixedbugs/bug407.dir/two.go b/test/fixedbugs/bug407.dir/two.go
new file mode 100644
index 000000000..67e1852ea
--- /dev/null
+++ b/test/fixedbugs/bug407.dir/two.go
@@ -0,0 +1,15 @@
+// Copyright 2012 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.
+
+// Use the functions in one.go so that the inlined
+// forms get type-checked.
+
+package two
+
+import "./one"
+
+func use() {
+ var r one.T
+ r.F()
+}
diff --git a/test/fixedbugs/bug407.go b/test/fixedbugs/bug407.go
new file mode 100644
index 000000000..50af6006f
--- /dev/null
+++ b/test/fixedbugs/bug407.go
@@ -0,0 +1,7 @@
+// $G $D/$F.dir/one.go && $G $D/$F.dir/two.go
+
+// Copyright 2011 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 ignored