mirror of
https://github.com/golang/go.git
synced 2026-04-01 17:07:17 +09:00
cmd/compile: allow fieldtrack of unexported fields
The fieldtrack support is experimental and used mainly inside Google, where we have included this change for years. No reason not to make it in the public copy. Change-Id: I5233e4e775ccce60a17098c007aed8c82a0425d7 Reviewed-on: https://go-review.googlesource.com/c/go/+/387355 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
@@ -1012,9 +1012,6 @@ func usefield(n *ir.SelectorExpr) {
|
||||
if outer.Sym() == nil {
|
||||
base.Errorf("tracked field must be in named struct type")
|
||||
}
|
||||
if !types.IsExported(field.Sym.Name) {
|
||||
base.Errorf("tracked field must be exported (upper case)")
|
||||
}
|
||||
|
||||
sym := reflectdata.TrackSym(outer, field)
|
||||
if ir.CurFunc.FieldTrack == nil {
|
||||
|
||||
Reference in New Issue
Block a user