From: griesemer
Date: Thu, 24 Aug 2017 13:05:53 +0000 (+0200)
Subject: spec: clarify nil case in type switches
X-Git-Tag: go1.10beta1~1375
X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=84ac90ebf1b2e6a747eec1469230087fe71c0ce9;p=gostls13.git
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/58490
Reviewed-by: Ian Lance Taylor
Reviewed-by: Matthew Dempsky
Reviewed-by: Rob Pike
---
diff --git a/doc/go_spec.html b/doc/go_spec.html
index 184b6960f4..6c0dc8bbd5 100644
--- a/doc/go_spec.html
+++ b/doc/go_spec.html
@@ -1,6 +1,6 @@
@@ -4820,8 +4820,9 @@ in the TypeSwitchGuard.
-The type in a case may be nil
;
-that case is used when the expression in the TypeSwitchGuard
+Instead of a type, a case may use the predeclared identifier
+nil
;
+that case is selected when the expression in the TypeSwitchGuard
is a nil
interface value.
There may be at most one nil
case.