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
cmd/compile: unsafe.Pointer not treated as a pointer for embedding #6357
Labels
Milestone
Comments
rsc
changed the title
cmd/gc: unsafe.Pointer not treated as a pointer for embedding
cmd/compile: unsafe.Pointer not treated as a pointer for embedding
Jun 8, 2015
tycho
added a commit
to tycho/go-sdl2
that referenced
this issue
Dec 26, 2015
With gccgo I was getting this: $ go build # github.com/veandco/go-sdl2/sdl_mixer ./sdl_mixer.go:83:2: error: embedded type may not be a pointer unsafe.Pointer ^ Apparently upstream Go hasn't yet added the above error[1]. Fixes veandco#167. [1] golang/go#6357 Signed-off-by: Steven Noonan <steven@uplinklabs.net>
Good news @griesemer, this issue has been fixed since at least Go1.7 (I couldn't get Go1.6 and earlier to build on my Macbook Pro) and it rightly matches gccgo's behavior producing Go1.7$ go version && go run main.go
go version go1.7.6 darwin/amd64
# command-line-arguments
./main.go:9: embedded type cannot be a pointer
./main.go:10: embedded type cannot be a pointer Go1.8 go version && go run main.go
go version go1.8.7 darwin/amd64
# command-line-arguments
./main.go:9: embedded type cannot be a pointer
./main.go:10: embedded type cannot be a pointer Go1.9$ go version && go run main.go
go version go1.9.7 darwin/amd64
# command-line-arguments
./main.go:9:2: embedded type cannot be a pointer
./main.go:10:2: embedded type cannot be a pointer Go1.10$ go version && go run main.go
go version go1.10.8 darwin/amd64
# command-line-arguments
./main.go:9:2: embedded type cannot be a pointer
./main.go:10:2: embedded type cannot be a pointer Go1.11$ go version && go run main.go
go version go1.11.13 darwin/amd64
# command-line-arguments
./main.go:9:2: embedded type cannot be a pointer
./main.go:10:2: embedded type cannot be a pointer Go1.12$ go version && go run main.go
go version go1.12.16 darwin/amd64
# command-line-arguments
./main.go:9:2: embedded type cannot be a pointer
./main.go:10:2: embedded type cannot be a pointer Go1.13$ go version && go run main.go
go version go1.13.11 darwin/amd64
# command-line-arguments
./main.go:9:2: embedded type cannot be a pointer
./main.go:10:2: embedded type cannot be a pointer Go1.14$ go version && go run main.go
go version go1.14.3 darwin/amd64
# command-line-arguments
./main.go:9:2: embedded type cannot be a pointer
./main.go:10:2: embedded type cannot be a pointer I shall let you close this issue as you please. Thank you. |
Appears fixed per the above comment. Verified in latest playground. Closing. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
The text was updated successfully, but these errors were encountered: