]> Cypherpunks repositories - gostls13.git/commitdiff
spec: be more precise with rules on specific types
authorRobert Griesemer <gri@golang.org>
Thu, 6 Jan 2022 05:37:04 +0000 (21:37 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 7 Jan 2022 02:37:20 +0000 (02:37 +0000)
Problem pointed out on golang-nuts mailing list.

Change-Id: If1c9b22e1ed7b4ec7ebcaadc80fa450333e6856c
Reviewed-on: https://go-review.googlesource.com/c/go/+/375799
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
doc/go_spec.html

index c0b224f9776fd9f3cbfeef7a6f52a790e3f9ad51..fa6630719b288f7c15c1f8e077ff41d824559d1b 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification - Go 1.18 Draft (incomplete)",
-       "Subtitle": "Version of Dec 16, 2021",
+       "Subtitle": "Version of Jan 6, 2022",
        "Path": "/ref/spec"
 }-->
 
@@ -1988,7 +1988,8 @@ More precisely, for a given interface, the set 𝑆 of specific types is defined
        </li>
 
        <li>For an interface with type elements, 𝑆 is the intersection
-               of the specific types of its type elements.
+               of the specific types of its type elements with specific types
+               (type elements that have no specific types are ignored).
        </li>
 
        <li>For a non-interface type term <code>T</code>
@@ -2021,7 +2022,7 @@ interface{ ~string }           // string
 interface{ int|~string }       // int, string
 interface{ Celsius|Kelvin }    // Celsius, Kelvin
 interface{ int; m() }          // int (but type set is empty because int has no method m)
-interface{ int; any }          // no specific types (intersection is empty)
+interface{ int; any }          // int (any has no specific types and is ignored)
 interface{ int; string }       // no specific types (intersection is empty)
 </pre>