diff --git a/doc/go_spec.html b/doc/go_spec.html index 061f933ae8..d3dc7ce9a3 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -1205,7 +1205,8 @@ func(n int) func(p *T)

An interface type defines a type set. A variable of interface type can store a value of any type that is in the type -set of the interface. Such a type is said to implement the interface. +set of the interface. Such a type is said to +implement the interface. The value of an uninitialized variable of interface type is nil.

@@ -1376,7 +1377,7 @@ definition of an interface's type set as follows:

+

+By construction, an interface's type set never contains an interface type. +

+
 // An interface representing only the type int.
 interface {
@@ -1519,6 +1524,27 @@ type Bad2 interface {
 }
 
+

Implementing an interface

+ +

+A type T implements an interface I if +

+ + + +

+A value x of type T implements an interface if T +implements the interface. +

+

Map types

@@ -1978,7 +2004,7 @@ and at least one of V or T is not a n

  • T is an interface type, but not a type parameter, and -x implements T. +x implements T.
  • x is the predeclared identifier nil and T @@ -2687,7 +2713,7 @@ type Constraint ~int // illegal: ~int is not inside a type paramet @@ -4018,7 +4044,7 @@ In this case, T must implement the (inte otherwise the type assertion is invalid since it is not possible for x to store a value of type T. If T is an interface type, x.(T) asserts that the dynamic type -of x implements the interface T. +of x implements the interface T.

    If the type assertion holds, the value of the expression is the value @@ -4290,7 +4316,8 @@ Missing type arguments may be inferred by a series of steps, described be Each step attempts to use known information to infer additional type arguments. Type inference stops as soon as all type arguments are known. After type inference is complete, it is still necessary to substitute all type arguments -for type parameters and verify that each type argument implements the relevant constraint; +for type parameters and verify that each type argument +implements the relevant constraint; it is possible for an inferred type argument to fail to implement a constraint, in which case instantiation fails.

    @@ -4344,7 +4371,7 @@ The process stops as soon as M has a type argument for each type paramete If an inference step fails, or if M is still missing type arguments after the last step, type inference fails.

    -

    Type unification

    +

    Type unification

    Type inference is based on type unification. A single unification step @@ -4421,7 +4448,7 @@ and the type literal []E, unification compares []float64 -

    Function argument type inference

    +

    Function argument type inference