summaryrefslogtreecommitdiff
path: root/test/fixedbugs/issue5089.go
diff options
context:
space:
mode:
authorDaniel Morsing <daniel.morsing@gmail.com>2013-03-20 22:18:20 +0100
committerDaniel Morsing <daniel.morsing@gmail.com>2013-03-20 22:18:20 +0100
commit8c97b0c80f4610ca01845174552cf0dacea0d129 (patch)
tree195da759b3ee615c081609a8251cf809a2232f96 /test/fixedbugs/issue5089.go
parentb4fc15a05ccc636f8b71daab34089c8c81c34ab5 (diff)
downloadgo-8c97b0c80f4610ca01845174552cf0dacea0d129.tar.gz
cmd/gc: reject methods on non-locals, even if symbol exists
Fixes issue 5089. R=golang-dev, rsc CC=golang-dev https://codereview.appspot.com/7767044
Diffstat (limited to 'test/fixedbugs/issue5089.go')
-rw-r--r--test/fixedbugs/issue5089.go15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/fixedbugs/issue5089.go b/test/fixedbugs/issue5089.go
new file mode 100644
index 000000000..14d6bde98
--- /dev/null
+++ b/test/fixedbugs/issue5089.go
@@ -0,0 +1,15 @@
+// errorcheck
+
+// Copyright 2013 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.
+
+// issue 5089: gc allows methods on non-locals if symbol already exists
+
+package p
+
+import "bufio"
+
+func (b *bufio.Reader) Buffered() int { // ERROR "non-local"
+ return -1
+}