]> Cypherpunks repositories - gostls13.git/commitdiff
spec: clarify nil case in type switches
authorgriesemer <gri@golang.org>
Thu, 24 Aug 2017 13:05:53 +0000 (15:05 +0200)
committerRobert Griesemer <gri@golang.org>
Fri, 25 Aug 2017 08:09:57 +0000 (08:09 +0000)
The old wording seemed to imply that nil is a kind of type.
Slightly reworded for clarity.

Fixes #21580.

Change-Id: I29898bf0125a10cb8dbb5c7e63ec5399ebc590ca
Reviewed-on: https://go-review.googlesource.com/58490
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Rob Pike <r@golang.org>
doc/go_spec.html

index 184b6960f4e86d3eeb6db45e7bac7040de7bb04b..6c0dc8bbd55a9db19b5790d14d67a2aced2fec2a 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of August 14, 2017",
+       "Subtitle": "Version of August 25, 2017",
        "Path": "/ref/spec"
 }-->
 
@@ -4820,8 +4820,9 @@ in the TypeSwitchGuard.
 </p>
 
 <p>
-The type in a case may be <a href="#Predeclared_identifiers"><code>nil</code></a>;
-that case is used when the expression in the TypeSwitchGuard
+Instead of a type, a case may use the predeclared identifier
+<a href="#Predeclared_identifiers"><code>nil</code></a>;
+that case is selected when the expression in the TypeSwitchGuard
 is a <code>nil</code> interface value.
 There may be at most one <code>nil</code> case.
 </p>