]> Cypherpunks.ru repositories - gostls13.git/commit
go/types: use a TypeList type to hold type arguments
authorRobert Findley <rfindley@google.com>
Thu, 19 Aug 2021 18:06:08 +0000 (14:06 -0400)
committerRobert Findley <rfindley@google.com>
Mon, 23 Aug 2021 13:09:11 +0000 (13:09 +0000)
commit7a6d64fed6e4122743aa204edd42a02e40ce9728
tree6f2a9fee40194decd63cd4614ac796eab0b5329f
parent2438660602677b1edf5e83a1ba4fdc5dfe9e9dcc
go/types: use a TypeList type to hold type arguments

This resolves an asymmetry between the TParams and TArgs APIs, and
reduces the size of the Named struct at the cost of some additional nil
checks.

While at it, move TParamList and TypeList to a new file:typelists.go,
and change TParamList to access the tparams slice directly in At. There
is no reason to guard against a nil receiver, as accessing an index on
the empty slice will panic anyway.

Change-Id: I9b65247e06c697a57a4efe40c3390e0faff91441
Reviewed-on: https://go-review.googlesource.com/c/go/+/343933
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/infer.go
src/go/types/instantiate.go
src/go/types/lookup.go
src/go/types/named.go
src/go/types/predicates.go
src/go/types/sizeof_test.go
src/go/types/subst.go
src/go/types/typelists.go [new file with mode: 0644]
src/go/types/typeparam.go
src/go/types/typestring.go
src/go/types/unify.go