aboutsummaryrefslogtreecommitdiff
path: root/src/encoding
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2023-06-22 16:40:46 -0700
committerGopher Robot <gobot@golang.org>2023-06-26 18:33:36 +0000
commitd49017a7c347e57830b87ebbbdbec087bfc1ca92 (patch)
tree8c90f335e7b136594da14a3a4fce9a3088ac6bcd /src/encoding
parentb3ca8d2b3c78d36595c534de0ca604e7d3e37123 (diff)
downloadgo-d49017a7c347e57830b87ebbbdbec087bfc1ca92.tar.xz
go/types, types2: fix interface unification
When unification of two types succeeds and at least one of them is an interface, we must be more cautious about when to accept the unification, to avoid order dependencies and unexpected inference results. The changes are localized and only affect matching against interfaces; they further restrict what are valid unifications (rather than allowing more code to pass). We may be able to remove some of the restriotions in a future release. See comments in code for a detailed description of the changes. Also, factored out "asInterface" functionality into a function to avoid needless repetition in the code. Fixes #60933. Fixes #60946. Change-Id: I923f7a7c1a22e0f4fd29e441e016e7154429fc5e Reviewed-on: https://go-review.googlesource.com/c/go/+/505396 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@google.com> Run-TryBot: Robert Griesemer <gri@google.com> Auto-Submit: Robert Griesemer <gri@google.com> Reviewed-by: Robert Findley <rfindley@google.com>
Diffstat (limited to 'src/encoding')
0 files changed, 0 insertions, 0 deletions