From 3b576a770413e799d487e861e3a75027f59ee81c Mon Sep 17 00:00:00 2001
From: Robert Griesemer
Date: Wed, 17 Jun 2009 14:31:33 -0700
Subject: [PATCH] fix for incorrect type switch clause: - nil is not a keyword
- type -> Type
R=rsc
DELTA=10 (4 added, 0 deleted, 6 changed)
OCL=30433
CL=30435
---
doc/go_spec.html | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/doc/go_spec.html b/doc/go_spec.html
index ab05fbcd1b..d6ba378072 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -7,6 +7,7 @@ Open issues:
- declaration "type T S" strips methods of S. why/why not?
- no mechanism to declare a local type name: type T P.T
+
Todo's:
[ ] document illegality of package-external tuple assignments to structs
w/ private fields: P.T(1, 2) illegal since same as P.T(a: 1, b: 2) for
@@ -447,7 +448,7 @@ because the size of the pointer itself is always known.
interface fit in here.)
-A type may have a method set associated with it
+A type may have a method set associated with it
(§Interface types, §Method declarations).
The method set of an interface type (§Interface types) is its interface.
The method set of any other named type T
@@ -1341,7 +1342,7 @@ If an identifier satisfies these two conditions:
declared at the top level;
-it will be exported automatically.
+it will be exported.
Const declarations
@@ -3303,10 +3304,13 @@ in the type assertion.
TypeSwitchStmt = "switch" [ [ SimpleStmt ] ";" ] TypeSwitchGuard "{" { TypeCaseClause } "}" .
TypeSwitchGuard = identifier ":=" Expression "." "(" "type" ")" .
TypeCaseClause = TypeSwitchCase ":" [ StatementList ] .
-TypeSwitchCase = "case" ( type | "nil" ) | "default" .
+TypeSwitchCase = "case" Type | "default" .
+As a special case, the type in the type switch case may be an
+identifier denoting the predeclared constant nil
+(§Predeclared identifiers).
If the interface value equals nil
,
only an explict nil
case or "default"
case will execute.