]> Cypherpunks.ru repositories - gostls13.git/commit
go/types, types2: simplify implementation of validType (fix TODO)
authorRobert Griesemer <gri@golang.org>
Fri, 3 Jun 2022 03:40:17 +0000 (20:40 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 6 Jun 2022 18:37:38 +0000 (18:37 +0000)
commitfc9707594910452cce3fba794fa9ffe541e8cefa
tree9fed63a3a8eb92f173364239c5d4a0a2f1075f2b
parent07eca49055f7ef0d73be2ca28dcc5d489db129b9
go/types, types2: simplify implementation of validType (fix TODO)

Now that validType is using the correct type nest (CL 409694),
the top entry of the type nest corresponds to the instantiated
type. Thus we can use that type instance to look up the value
of type parameters, there's no need anymore to create an environment
to look up type arguments.

Remove the need to pass around the environment and remove all
associated types and functions.

Updates #52698.

Change-Id: Ie37eace88896386e667ef93c77a4fc3cd0be6eb9
Reviewed-on: https://go-review.googlesource.com/c/go/+/410294
Reviewed-by: Robert Findley <rfindley@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
Run-TryBot: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/validtype.go
src/go/types/validtype.go