diff options
author | Robert Griesemer <gri@golang.org> | 2015-08-04 11:29:28 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2015-08-05 17:01:05 +0000 |
commit | 85789daac3ed499683dd03ae7a35bf30dc1e74c0 (patch) | |
tree | e2c93ab30a48455060a6074ecedcebad6fb3b6c1 | |
parent | 87c8707e6ffa40937191ae37e27af5d17d1a215a (diff) | |
download | go-85789daac3ed499683dd03ae7a35bf30dc1e74c0.tar.gz go-85789daac3ed499683dd03ae7a35bf30dc1e74c0.zip |
spec: clarify that short variable declarations can redeclare parameters
Fixes #9837.
Change-Id: Ia513c7e5db221eee8e3ab0affa6d3688d2099fd9
Reviewed-on: https://go-review.googlesource.com/13130
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
-rw-r--r-- | doc/go_spec.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/doc/go_spec.html b/doc/go_spec.html index fd47f10530..b3d50888ad 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -2006,12 +2006,12 @@ _, y, _ := coord(p) // coord() returns three values; only interested in y coord </pre> <p> -Unlike regular variable declarations, a short variable declaration may redeclare variables provided they -were originally declared earlier in the same block with the same type, and at -least one of the non-<a href="#Blank_identifier">blank</a> variables is new. As a consequence, redeclaration -can only appear in a multi-variable short declaration. -Redeclaration does not introduce a new -variable; it just assigns a new value to the original. +Unlike regular variable declarations, a short variable declaration may <i>redeclare</i> +variables provided they were originally declared earlier in the same block +(or the parameter lists if the block is the function body) with the same type, +and at least one of the non-<a href="#Blank_identifier">blank</a> variables is new. +As a consequence, redeclaration can only appear in a multi-variable short declaration. +Redeclaration does not introduce a new variable; it just assigns a new value to the original. </p> <pre> |