]> Cypherpunks.ru repositories - gostls13.git/commit
test: add test case for type parameter method indexing
authorMatthew Dempsky <mdempsky@google.com>
Sat, 6 Aug 2022 19:02:03 +0000 (12:02 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 8 Aug 2022 17:39:25 +0000 (17:39 +0000)
commitd02d5fda653f9e7ca2bb6036ccddc61a869abad5
treee46c6e3a0d2349fadb87123202e3bdbc19948194
parentd42b520b037311b406da9fcb564f3ef5f91470d7
test: add test case for type parameter method indexing

When types2 type checks a method expression or method value that
selects a type parameter method, the Selection.Index is indexed based
on the method's index within the type parameter's constraint
interface.

However, with a fully-stenciled implementation, naively using the
index would result in picking a method from the corresponding type
argument's full method set, which could select a different method.

Unified IR currently avoids this because it selects methods based on
name, not index; but experimenting with index-based selection revealed
that there are no test cases that would have caught this failure case.

Change-Id: Idbc39e1ee741714203d4749e47f5bc015af25020
Reviewed-on: https://go-review.googlesource.com/c/go/+/421815
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
test/typeparam/mdempsky/19.go [new file with mode: 0644]