]> Cypherpunks repositories - gostls13.git/commitdiff
go/types: document unfixable bug at Selection.Indirect
authorAlan Donovan <adonovan@google.com>
Mon, 9 Oct 2023 18:18:06 +0000 (14:18 -0400)
committerAlan Donovan <adonovan@google.com>
Mon, 9 Oct 2023 18:55:34 +0000 (18:55 +0000)
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>

src/cmd/compile/internal/types2/selection.go
src/go/types/selection.go

index 0fa771938d75827def32f181ea1396d8b15ac352..dfbf3a0191c1e457f6434c9dc519b68cada06687 100644 (file)
@@ -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) }
index 02615846b8ac4a30d8bc80cda265a5316ecd7723..50d340c738afbbf000d343bbeeba4bf8633841b7 100644 (file)
@@ -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) }