From b89a54e5c68df4d4d9b39512accd3a69b082cbba Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Wed, 20 May 2009 18:16:04 -0700 Subject: [PATCH] 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 --- doc/go_spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.48.1