commit | acc90c53e8b5448afee8455ee7c4917af25c6bc9 | [log] [tgz] |
---|---|---|
author | acanino <anthony.canino1@gmail.com> | Fri Aug 21 22:24:20 2015 -0400 |
committer | Brad Fitzpatrick <bradfitz@golang.org> | Sat Oct 03 15:32:46 2015 +0000 |
tree | f3709eb509a1d7f30c68e022e184467e0115237f | |
parent | 788eb99b76d0817d238c3ad0952eb1fe6349f735 [diff] |
cmd/compile: Fix `internal compiler: getinarg: not a func` when returning invalid interface. Internal error arose from calling methodfunc on a invalid interface field during the implements check. int obviously isn't a function, and errors on getinarg... for im := iface.Type; im != nil; im = im.Down { imtype = methodfunc(im.Type, nil) // ... } Fix handles the internal compiler error, but does not throw an additional error, i.e. the following code will error on the I interface, but type A will pass the implements check since 'Read(string) string' is implemented and 'int' is skipped type I interface { Read(string) string int } type A struct { } func (a *A) Read(s string) string { return s } func New() I { return new(A) } Fixes #10975 Change-Id: I4b54013afb2814db3f315515f0c742d8631ca500 Reviewed-on: https://go-review.googlesource.com/13747 Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
For documentation about how to install and use Go, visit https://golang.org/ or load doc/install-source.html in your web browser.
Our canonical Git repository is located at https://go.googlesource.com/go. There is a mirror of the repository at https://github.com/golang/go.
Go is the work of hundreds of contributors. We appreciate your help!
To contribute, please read the contribution guidelines: https://golang.org/doc/contribute.html
Unless otherwise noted, the Go source files are distributed under the BSD-style license found in the LICENSE file.
If you have just untarred a binary Go distribution, you need to set the environment variable $GOROOT to the full path of the go directory (the one containing this file). You can omit the variable if you unpack it into /usr/local/go, or if you rebuild from sources by running all.bash (see doc/install-source.html). You should also add the Go binary directory $GOROOT/bin to your shell's path.
For example, if you extracted the tar file into $HOME/go, you might put the following in your .profile:
export GOROOT=$HOME/go export PATH=$PATH:$GOROOT/bin
See https://golang.org/doc/install or doc/install.html for more details.