Skip to content

Commit 8222423

Browse files
committed
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 <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]>
1 parent a8ca649 commit 8222423

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ func (s *Selection) Index() []int { return s.index }
135135

136136
// Indirect reports whether any pointer indirection was required to get from
137137
// x to f in x.f.
138+
//
139+
// Beware: Indirect spuriously returns true (Go issue #8353) for a
140+
// MethodVal selection in which the receiver argument and parameter
141+
// both have type *T so there is no indirection.
142+
// Unfortunately, a fix is too risky.
138143
func (s *Selection) Indirect() bool { return s.indirect }
139144

140145
func (s *Selection) String() string { return SelectionString(s, nil) }

src/go/types/selection.go

Lines changed: 5 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)