Repository: go
Issue: x/mobile/cmd/gomobile: bind fails with interface syntax
Labels: NeedsInvestigation,mobile

Please answer these questions before submitting your issue. Thanks!

### What version of Go are you using (`go version`)?

go version go1.11 darwin/amd64
gomobile version +bceb7ef Wed Aug 8 22:10:59 2018 +0000 (android,ios); androidSDK=

### Does this issue reproduce with the latest release?

yes

### What operating system and processor architecture are you using (`go env`)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/michael/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/michael/Projects/golang"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/bd/rnhtmc553vvcm_ty8nt2tv4c0000gn/T/go-build433537712=/tmp/go-build -gno-record-gcc-switches -fno-common"

### What did you do?

I'm try to build [v2ray](https://github.com/v2ray/v2ray-core/) for ios app. 

``` shell
gomobile bind -target=ios v2ray.com/core
```

fail:
```
gomobile: darwin-arm: go build -tags ios -buildmode=c-archive -o /var/folders/bd/rnhtmc553vvcm_ty8nt2tv4c0000gn/T/gomobile-work-288847091/core-arm.a gobind failed: exit status 2
# gobind
/var/folders/bd/rnhtmc553vvcm_ty8nt2tv4c0000gn/T/gomobile-work-288847091/src/gobind/go_coremain.go:1258:9: cannot use (*proxycore_OutboundHandler)(_res_ref) (type *proxycore_OutboundHandler) as type core.OutboundHandler in assignment:
        *proxycore_OutboundHandler does not implement core.OutboundHandler (missing Dispatch method)
/var/folders/bd/rnhtmc553vvcm_ty8nt2tv4c0000gn/T/gomobile-work-288847091/src/gobind/go_coremain.go:1273:9: cannot use (*proxycore_OutboundHandler)(_res_ref) (type *proxycore_OutboundHandler) as type core.OutboundHandler in assignment:
        *proxycore_OutboundHandler does not implement core.OutboundHandler (missing Dispatch method)

```

a simplified case like this
``` go
package hello

//import "context"
//
//type A interface {
//	Run(ctx context.Context)
//}
//
//type BB interface {
//	GetA() A
//}

//------- or -------

type C bool

type A interface {
	AA() C
}

type BB interface {
	AAA() A
}
```
``` shell
gomobile bind -target=ios v2ray.com/core/hello
```

result
```
gomobile: darwin-arm: go build -tags ios -buildmode=c-archive -o /var/folders/bd/rnhtmc553vvcm_ty8nt2tv4c0000gn/T/gomobile-work-922396824/hello-arm.a gobind failed: exit status 2
# gobind
/var/folders/bd/rnhtmc553vvcm_ty8nt2tv4c0000gn/T/gomobile-work-922396824/src/gobind/go_hellomain.go:55:9: cannot use (*proxyhello_A)(_res_ref) (type *proxyhello_A) as type hello.A in assignment:
        *proxyhello_A does not implement hello.A (missing AA method)
```
### What did you expect to see?

Success build