[dev.typealias] cmd/compile, reflect: fix struct field names for embedded byte, rune

Will also fix type aliases.

Fixes #17766.
For #18130.

Change-Id: I9e1584d47128782152e06abd0a30ef423d5c30d2
Reviewed-on: https://go-review.googlesource.com/35732
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Russ Cox 2017-01-25 10:19:33 -05:00
parent 43c7094386
commit 9bbb07ddec
8 changed files with 85 additions and 62 deletions

View file

@ -390,9 +390,13 @@ type ptrtype struct {
}
type structfield struct {
name name
typ *_type
offset uintptr
name name
typ *_type
offsetAnon uintptr
}
func (f *structfield) offset() uintptr {
return f.offsetAnon >> 1
}
type structtype struct {
@ -650,7 +654,7 @@ func typesEqual(t, v *_type) bool {
if tf.name.tag() != vf.name.tag() {
return false
}
if tf.offset != vf.offset {
if tf.offsetAnon != vf.offsetAnon {
return false
}
}