-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not correct 'interface contains embedded non-interface' error depending on the order of source files #22580
Comments
I think people might be hesitant of downloading and unpacking .zip files. Generally it might be better to just place the code in a gist or provide some links to the playground. |
Okay, no problem, I have created a gist example and adapted the desciption. |
I cannot reproduce any error. I have created one file for each of your gist code snippets, named as your snippets, all in a clean empty directory. go build builds w/o complaints. Please clarify how you produced an error by providing step by step instructions, or close this issue. Thanks. |
Actually I have just downloaded the ZIP file from the gist, ran
|
There is some really weird behaviour going on here. In an attempt to simplify the code to reproduce the issue, I've deleted the B.go file and now I'm getting:
Quite an odd one. Exact reproduction steps that I've followed:
I have go1.9.2 darwin/amd64 |
@gbbr I cannot reproduce this. Deleting B.go is fine. The code looks valid. I am using the latest version at tip, albeit on OS X not Windows. |
Very odd. I've no clue why it breaks for both me and @michielvi but not you. I've even recorded a screen capture and put it on YouTube. |
I cannot reproduce on Linux either. I tested at both f29f5f6882 and go1.9.2. @michielvi @gbbr Can you include the output of "go build -x"? I'm wondering if cmd/go isn't sorting the .go files on Windows like it does on Linux / OS X. |
I tried manually running the compiler (go1.9.2) with a different file ordering and discovered:
|
Here's a standalone and further reduced repro case:
|
The reduced repro case fails at go1.9.2, but compiles okay at tip. We must have inadvertently fixed the underlying compiler issue since then. I'm still curious about "go build -x" output on Windows though. |
It appears the compiler issue was fixed by 25159d3. (Issue still repros immediately before that CL, and no longer does after.) |
Here is the 'go build -x' output:
|
I can confirm that this is now fixed. It is reproducible with the 1.9.2 release but not with the tip commit.
Closing. Thanks @michielvi |
Okay, thank you all too. I am looking forward for this fix. |
What version of Go are you using (
go version
)?1.9.2
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Development\GoWorkspace
set GORACE=
set GOROOT=C:\Development\Go
set GOTOOLDIR=C:\Development\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0
set CXX=g++
set CGO_ENABLED=1
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
What did you do?
There is a not correct 'interface contains embedded non-interface' error. When changing the order of file (by renaming them), the error is not anymore there.
To reproduce this error, download gist example in src directory and do 'go build'.
Strange behavior:
What did you expect to see?
Never an 'interface contains embedded non-interface' error.
The text was updated successfully, but these errors were encountered: