Skip to content

Commit 84ac90e

Browse files
committed
spec: clarify nil case in type switches
The old wording seemed to imply that nil is a kind of type. Slightly reworded for clarity. Fixes golang#21580. Change-Id: I29898bf0125a10cb8dbb5c7e63ec5399ebc590ca Reviewed-on: https://go-review.googlesource.com/58490 Reviewed-by: Ian Lance Taylor <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]> Reviewed-by: Rob Pike <[email protected]>
1 parent 770d8d8 commit 84ac90e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/go_spec.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--{
22
"Title": "The Go Programming Language Specification",
3-
"Subtitle": "Version of August 14, 2017",
3+
"Subtitle": "Version of August 25, 2017",
44
"Path": "/ref/spec"
55
}-->
66

@@ -4820,8 +4820,9 @@ <h4 id="Type_switches">Type switches</h4>
48204820
</p>
48214821

48224822
<p>
4823-
The type in a case may be <a href="#Predeclared_identifiers"><code>nil</code></a>;
4824-
that case is used when the expression in the TypeSwitchGuard
4823+
Instead of a type, a case may use the predeclared identifier
4824+
<a href="#Predeclared_identifiers"><code>nil</code></a>;
4825+
that case is selected when the expression in the TypeSwitchGuard
48254826
is a <code>nil</code> interface value.
48264827
There may be at most one <code>nil</code> case.
48274828
</p>

0 commit comments

Comments
 (0)