]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: use an identifier map rather than isubst for recv type params
authorRobert Findley <rfindley@google.com>
Thu, 7 Oct 2021 23:12:16 +0000 (19:12 -0400)
committerRobert Findley <rfindley@google.com>
Fri, 8 Oct 2021 02:09:58 +0000 (02:09 +0000)
commite74db46519a7cbed16a7f14932da2ef93d647ece
tree3b07908b587b11945165042cbb3a3aaa3d28f150
parent8c4ea3140e7c79d828fe7683a3dfe3474a9938fb
go/types: use an identifier map rather than isubst for recv type params

Receiver type parameters are the only type expressions allowed to be
blank. Previously this was handled by substitution of synthetic
non-blank names in the receiver type expression, but that introduced
problems related to AST mangling: the scope had extra elements,
Object.Name() was inaccurate, and synthetic nodes were recorded in
types.Info.

Fix this instead by recording a map of *ast.Ident->*TypeParam on the
Checker, which is read in Checker.ident to resolve blank identifiers
denoting receiver type parameters.

Change-Id: I6a7a86b823409f54778c0f141e8bd269a2cc85d9
Reviewed-on: https://go-review.googlesource.com/c/go/+/354643
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/go/types/check.go
src/go/types/signature.go
src/go/types/typexpr.go