Skip to content

cmd/compile: seemingly identical anonymous types lead to confusing error messages #18911

Closed
@zzz125

Description

@zzz125

What version of Go are you using (go version)?

1.8rc3 (broken, also in rc1)
1.7.5 (works)

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/k/dev/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build538144559=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"

What did you do?

https://play.golang.org/p/rQzEbb-u6Y

also, this is my test code with modules (i cant simulate it in playground):
test.zip

to run it, set GOPATH and run it with:
$ go run src/a.go

the output for go1.7 is:
-> main.X main.X
Hello, playground {2 3}

for go1.8:
panic: interface conversion: interface {} is struct { x int; y int }, not struct { x int; y int }

it does't work in my another project either now, after switching to 1.8rc

What did you expect to see?

old behaviour as in go 1.7 where it works

What did you see instead?

panic: interface conversion: interface {} is struct { x int; y int }, not struct { x int; y int }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions