Commit 84ac90eb authored by griesemer's avatar griesemer Committed by Robert Griesemer

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 #21580.

Change-Id: I29898bf0125a10cb8dbb5c7e63ec5399ebc590ca
Reviewed-on: https://go-review.googlesource.com/58490Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent 770d8d82
<!--{
"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>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment