mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: fix and improve struct field reflect information
The previous logic was overly complicated, generated suboptimally encoded struct type descriptors, and mishandled embeddings of predeclared universal types. Fixes #21122. Fixes #21353. Fixes #21696. Fixes #21702. Updates #21357. Change-Id: If34761fa6dbe4af2af59dee501e7f30845320376 Reviewed-on: https://go-review.googlesource.com/60410 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org>
This commit is contained in:
parent
812b34efae
commit
d349fa25df
4 changed files with 111 additions and 54 deletions
|
|
@ -655,15 +655,15 @@ func typesEqual(t, v *_type, seen map[_typePair]struct{}) bool {
|
|||
if len(st.fields) != len(sv.fields) {
|
||||
return false
|
||||
}
|
||||
if st.pkgPath.name() != sv.pkgPath.name() {
|
||||
return false
|
||||
}
|
||||
for i := range st.fields {
|
||||
tf := &st.fields[i]
|
||||
vf := &sv.fields[i]
|
||||
if tf.name.name() != vf.name.name() {
|
||||
return false
|
||||
}
|
||||
if tf.name.pkgPath() != vf.name.pkgPath() {
|
||||
return false
|
||||
}
|
||||
if !typesEqual(tf.typ, vf.typ, seen) {
|
||||
return false
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue