]> Cypherpunks repositories - gostls13.git/commit
go/internal/gccgoimporter: improve alias handling for anonymous fields
authorThan McIntosh <thanm@google.com>
Thu, 18 Apr 2019 13:45:40 +0000 (09:45 -0400)
committerThan McIntosh <thanm@google.com>
Fri, 19 Apr 2019 19:47:53 +0000 (19:47 +0000)
commitdc193dee15294e451ceaae2e50e539255f4a37b6
treea001f63b721a863acc1eafe5ffbe88a90ac22e90
parent4590abe0723cbe639f88578d9d570b136ba0850b
go/internal/gccgoimporter: improve alias handling for anonymous fields

The code in the parser that deals with anonymous structure fields
records the fact that a field is anonymous, then tries to install a proxy
name for the field based on the name of the type used to declare
the field. If that type was an alias, the current recipe for determining
the proxy name was not working properly; enhance the code to recover
and report the alias name used.

Fixes #31540.

Change-Id: I9b7369ed558a288b56d85170c6f1144daf5228eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/172603
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/go/internal/gccgoimporter/importer_test.go
src/go/internal/gccgoimporter/parser.go
src/go/internal/gccgoimporter/testdata/issue31540.go [new file with mode: 0644]
src/go/internal/gccgoimporter/testdata/issue31540.gox [new file with mode: 0644]