<!--{
"Title": "The Go Programming Language Specification - Go 1.18 Draft (incomplete)",
- "Subtitle": "Version of Nov 24, 2021",
+ "Subtitle": "Version of Nov 29, 2021",
"Path": "/ref/spec"
}-->
<p>
An interface specification which contains <a href="#Interface_types">type elements</a>
-that are not interface types defines a (possibly empty) set of <i>specific types</i>.
+defines a (possibly empty) set of <i>specific types</i>.
Loosely speaking, these are the types <code>T</code> that appear in the
interface definition in terms of the form <code>T</code>, <code>~T</code>,
or in unions of such terms.
</p>
<p>
-More precisely, for a given interface, the set of specific types is defined as follows:
+More precisely, for a given interface, the set 𝑆 of specific types is defined as follows:
</p>
<ul>
- <li>The set of specific types of the empty interface is the empty set.
+ <li>For an interface with no type elements, 𝑆 is the empty set.
</li>
- <li>The set of specific types of a non-empty interface is the intersection
- of the specific types of its interface elements.
+ <li>For an interface with type elements, 𝑆 is the intersection
+ of the specific types of its type elements.
</li>
- <li>The set of specific types of a method specification is the empty set.
+ <li>For a non-interface type term <code>T</code>
+ or <code>~T</code>, 𝑆 is the set consisting of the type <code>T</code>.
</li>
- <li>The set of specific types of a non-interface type term <code>T</code>
- or <code>~T</code> is the set consisting of the type <code>T</code>.
- </li>
-
- <li>The set of specific types of a <i>union</i> of terms
- <code>t<sub>1</sub>|t<sub>2</sub>|…|t<sub>n</sub></code>
- is the union of the specific types of the terms.
+ <li>For a <i>union</i> of terms
+ <code>t<sub>1</sub>|t<sub>2</sub>|…|t<sub>n</sub></code>,
+ 𝑆 is the union of the specific types of the terms.
</li>
</ul>
<p>
-If the set of specific types is empty, the interface has <i>no specific types</i>.
+If 𝑆 is empty, the interface has <i>no specific types</i>.
+An interface may have specific types even if its <a href="#Interface_types">type set</a>
+is empty.
</p>
<p>
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; string } // no specific types (intersection is empty)
</pre>
<p>
If <code>f</code> denotes a parameterized function, it must be
-<a href="#Instantiations">instantiated</a> before it can be called.
+<a href="#Instantiations">instantiated</a> before it can be called
+or used as a function value.
</p>
<p>
specific type of <code>V</code> can be converted to <code>T</code>.
</li>
<li>
-Only <code>T</code> is a type parameter and <code>x</code> can can be converted to each
+Only <code>T</code> is a type parameter and <code>x</code> can be converted to each
specific type of <code>T</code>.
</li>
</ul>