From: Russ Cox Date: Thu, 21 May 2009 01:16:04 +0000 (-0700) Subject: new, stricter interface rule: X-Git-Tag: weekly.2009-11-06~1588 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b89a54e5c68df4d4d9b39512accd3a69b082cbba;p=gostls13.git new, stricter interface rule: in x.(T) x cannot be a nil (uninitialized) interface variable. remove TODO per discussion. DELTA=3 (1 added, 1 deleted, 1 changed) OCL=29123 CL=29134 --- diff --git a/doc/go_spec.html b/doc/go_spec.html index 7e66b6542f..4809d0751f 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -2210,7 +2210,8 @@ x.(T)

-asserts that the value stored in x is of type T. +asserts that x is not the zero interface value +and that the value stored in x is of type T. The notation x.(T) is called a type assertion. The type of x must be an interface type.

@@ -2220,7 +2221,6 @@ that the dynamic type of x is identical to the type T (§Type identity and compatibility). If T is an interface type, x.(T) asserts that the dynamic type of T implements the interface T (§Interface types). -TODO: gri wants an error if x is already of type T.

If the type assertion holds, the value of the expression is the value