mirror of
https://github.com/golang/go
synced 2024-11-08 18:16:10 -07:00
0a8e347751
As of https://golang.org/cl/43456 gccgo now gives a better error message for this test. Before: fixedbugs/issue5089.go:13:1: error: redefinition of ‘bufio.Buffered’: receiver name changed func (b *bufio.Reader) Buffered() int { // ERROR "non-local|redefinition" ^ fixedbugs/issue5089.go:11:13: note: previous definition of ‘bufio.Buffered’ was here import "bufio" // GCCGO_ERROR "previous" ^ Now: fixedbugs/issue5089.go:13:7: error: may not define methods on non-local type func (b *bufio.Reader) Buffered() int { // ERROR "non-local|redefinition" ^ Change-Id: I4112ca8d91336f6369f780c1d45b8915b5e8e235 Reviewed-on: https://go-review.googlesource.com/c/130955 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
16 lines
362 B
Go
16 lines
362 B
Go
// 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|redefinition"
|
|
return -1
|
|
}
|