From: Russ Cox Date: Tue, 22 Feb 2022 19:43:41 +0000 (-0500) Subject: cmd/compile: allow fieldtrack of unexported fields X-Git-Tag: go1.19beta1~1131 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=7fd9564fcd3715a2aaf2bf4df1096f71ff40ef15;p=gostls13.git 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 Run-TryBot: Russ Cox TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor --- diff --git a/src/cmd/compile/internal/walk/expr.go b/src/cmd/compile/internal/walk/expr.go index e5bf6cf0b5..43201dbd3d 100644 --- a/src/cmd/compile/internal/walk/expr.go +++ b/src/cmd/compile/internal/walk/expr.go @@ -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 {