From 5d0400c72de968dffacc3e2004808758894ea433 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Wed, 11 May 2022 14:40:34 -0700 Subject: [PATCH] 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 --- doc/go_spec.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 -- 2.50.0