From: Robert Griesemer Date: Wed, 11 May 2022 21:40:34 +0000 (-0700) Subject: spec: adjust scope of function/method type parameters X-Git-Tag: go1.19beta1~290 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=5d0400c72de968dffacc3e2004808758894ea433;p=gostls13.git spec: adjust scope of function/method type parameters Change scope rules per the accepted proposal #52038. Match prose for type parameters of type declarations. Fixing the implementation is tracked by #51503. Fixes #52038. For #51503. Change-Id: Iebd88a82c896b7b2e8520cd514ef6a2cc903e807 Reviewed-on: https://go-review.googlesource.com/c/go/+/405754 Reviewed-by: Robert Griesemer Reviewed-by: Ian Lance Taylor --- diff --git a/doc/go_spec.html b/doc/go_spec.html index b272cb5df6..70efddf626 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -2158,9 +2158,8 @@ Go is lexically scoped using blocks: or result variable is the function body.
  • The scope of an identifier denoting a type parameter of a function - or declared by a method receiver is the function body and all parameter lists of the - function. -
  • + or declared by a method receiver begins after the name of the function + and ends at the end of the function body.
  • The scope of an identifier denoting a type parameter of a type begins after the name of the type and ends at the end