aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan Donovan <adonovan@google.com>2023-10-09 14:18:06 -0400
committerAlan Donovan <adonovan@google.com>2023-10-09 18:55:34 +0000
commit8222423e0384cce56de31fe2c38572da0a5c1943 (patch)
treeb9ce508faf64bc2afc712a86ae17798f2dd4b11c /src
parenta8ca649bbee624093392bc5556fb12ddd767bab6 (diff)
downloadgo-8222423e0384cce56de31fe2c38572da0a5c1943.tar.xz
go/types: document unfixable bug at Selection.Indirect
Updates #8353 Change-Id: I80cdbfccb8f7db00e04c293a68aaebc7c71bbbe9 Reviewed-on: https://go-review.googlesource.com/c/go/+/533935 Reviewed-by: Robert Griesemer <gri@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src')
-rw-r--r--src/cmd/compile/internal/types2/selection.go5
-rw-r--r--src/go/types/selection.go5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/selection.go b/src/cmd/compile/internal/types2/selection.go
index 0fa771938d..dfbf3a0191 100644
--- a/src/cmd/compile/internal/types2/selection.go
+++ b/src/cmd/compile/internal/types2/selection.go
@@ -135,6 +135,11 @@ func (s *Selection) Index() []int { return s.index }
// Indirect reports whether any pointer indirection was required to get from
// x to f in x.f.
+//
+// Beware: Indirect spuriously returns true (Go issue #8353) for a
+// MethodVal selection in which the receiver argument and parameter
+// both have type *T so there is no indirection.
+// Unfortunately, a fix is too risky.
func (s *Selection) Indirect() bool { return s.indirect }
func (s *Selection) String() string { return SelectionString(s, nil) }
diff --git a/src/go/types/selection.go b/src/go/types/selection.go
index 02615846b8..50d340c738 100644
--- a/src/go/types/selection.go
+++ b/src/go/types/selection.go
@@ -137,6 +137,11 @@ func (s *Selection) Index() []int { return s.index }
// Indirect reports whether any pointer indirection was required to get from
// x to f in x.f.
+//
+// Beware: Indirect spuriously returns true (Go issue #8353) for a
+// MethodVal selection in which the receiver argument and parameter
+// both have type *T so there is no indirection.
+// Unfortunately, a fix is too risky.
func (s *Selection) Indirect() bool { return s.indirect }
func (s *Selection) String() string { return SelectionString(s, nil) }