r244889 - in /trunk/gcc: go/gofrontend/MERGE go...
ian@gcc.gnu.org
ian@gcc.gnu.org
Wed Jan 25 05:12:00 GMT 2017
Author: ian
Date: Wed Jan 25 05:12:26 2017
New Revision: 244889
URL: https://gcc.gnu.org/viewcvs?rev=244889&root=gcc&view=rev
Log:
compiler: improvements for type alias handling
Give an error for an attempt to define a method on an imported type.
Give an error for each attempt to define a method on a builtin type.
Adjust error messages to be closer to gc error messages.
With these changes gccgo passes current tests on dev.typealias branch.
This changes the errors printed for test/fixedbugs/issue5089.go, but
the change is an improvement:
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"
^
Reviewed-on: https://go-review.googlesource.com/35642
Modified:
trunk/gcc/go/gofrontend/MERGE
trunk/gcc/go/gofrontend/gogo.cc
trunk/gcc/testsuite/go.test/test/fixedbugs/issue5089.go
More information about the Gcc-cvs
mailing list