internal/reflectlite: fix comment about meaning of flag field

Copied current (presumably correct) comment text from reflect package.

Change-Id: I19582b3675fbcb96a925002498d24ad2b7bc6178
Reviewed-on: https://go-review.googlesource.com/c/go/+/681935
Reviewed-by: Keith Randall <khr@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
This commit is contained in:
Keith Randall 2025-06-14 16:38:26 -07:00 committed by Keith Randall
parent 816199e421
commit 3254c2bb83

View file

@ -43,17 +43,19 @@ type Value struct {
ptr unsafe.Pointer
// flag holds metadata about the value.
// The lowest bits are flag bits:
//
// The lowest five bits give the Kind of the value, mirroring typ.Kind().
//
// The next set of bits are flag bits:
// - flagStickyRO: obtained via unexported not embedded field, so read-only
// - flagEmbedRO: obtained via unexported embedded field, so read-only
// - flagIndir: val holds a pointer to the data
// - flagAddr: v.CanAddr is true (implies flagIndir)
// Value cannot represent method values.
// The next five bits give the Kind of the value.
// This repeats typ.Kind() except for method values.
// The remaining 23+ bits give a method number for method values.
// If flag.kind() != Func, code can assume that flagMethod is unset.
// - flagAddr: v.CanAddr is true (implies flagIndir and ptr is non-nil)
// - flagMethod: v is a method value.
// If ifaceIndir(typ), code can assume that flagIndir is set.
//
// The remaining 22+ bits give a method number for method values.
// If flag.kind() != Func, code can assume that flagMethod is unset.
flag
// A method value represents a curried method invocation