]> Cypherpunks repositories - gostls13.git/commit
go/types: ensure that we always get a new signature in expandNamed
authorRobert Findley <rfindley@google.com>
Wed, 15 Sep 2021 21:18:37 +0000 (17:18 -0400)
committerRobert Findley <rfindley@google.com>
Fri, 17 Sep 2021 22:19:21 +0000 (22:19 +0000)
commit3fa35b5f9741d7d1c9a9e047057c7210da04fbba
tree7ffdc54df20d009a2f38bd40c6d4b8f4274b8e54
parent3fa7dbeff53b56edd98f295bd0c34423c080ac57
go/types: ensure that we always get a new signature in expandNamed

CL 349412 introduced a bug when Checker.subst does not return a new
signature: we were still setting the receiver to the instantiated type.

I'm not sure how this could manifest in practice (other than confusing
object strings). It's possible that I could generate a testdata-driven
test for this, but in the interest of time I just added a test to verify
object strings.

Change-Id: I29bc8e1419ddc4574755c3def52d18cb71c738eb
Reviewed-on: https://go-review.googlesource.com/c/go/+/350143
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/instantiate_test.go
src/go/types/named.go