]> Cypherpunks.ru repositories - gostls13.git/commitdiff
spec: fix unification rule for inexact interface unification
authorRobert Griesemer <gri@golang.org>
Mon, 14 Aug 2023 21:21:53 +0000 (14:21 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 17 Aug 2023 22:56:50 +0000 (22:56 +0000)
Irrespective of whether unification is exact or inexact, method
signatures of interfaces must always match exactly: a type never
satisfies/implements an interface if relevant method signatures
are different (i.e., not identical, possibly after substitution).

This change matches the fix https://go.dev/cl/519435.

For #61879.

Change-Id: I28b0a32d32626d85afd32e107efce141235a923d
Reviewed-on: https://go-review.googlesource.com/c/go/+/519455
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>

doc/go_spec.html

index c7b032b57e3639b3165c41c860b973734649ba94..301fdb3cf1cbbfaddc2fc01416eac921bd76125d 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of Aug 2, 2023",
+       "Subtitle": "Version of Aug 17, 2023",
        "Path": "/ref/spec"
 }-->
 
@@ -8488,7 +8488,7 @@ Finally, two types that are not bound type parameters unify loosely
        identical <a href="#Interface_types">type terms</a>,
        both or neither embed the predeclared type
        <a href="#Predeclared_identifiers">comparable</a>,
-       corresponding method types unify per the element matching mode,
+       corresponding method types unify exactly,
        and the method set of one of the interfaces is a subset of
        the method set of the other interface.
 </li>