go/internal/typeparams
Robert Findley caecc2b0ac internal/typeparams: add a generic form of types.AssignableTo
For some use-cases, it is helpful to compute predicates between
uninstantiated generic types.

This CL implements one such predicate for types.AssignableTo, a helper
GenericAssignableTo which reports if, for generic types V and T with the
same number of type parameters, all instantiations V[A_1, ..., A_N] are
assignable to the corresponding instantiation T[A_1, ..., A_N].

For #50887
For #50447

Change-Id: I7a0550fba05666bb2375d478d5390a123e09f556
Reviewed-on: https://go-review.googlesource.com/c/tools/+/383094
Trust: Robert Findley <rfindley@google.com>
Run-TryBot: Robert Findley <rfindley@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-02-08 16:50:25 +00:00
..
example internal/typeparams/example: start adding a guide to generics for tools 2022-01-22 21:07:13 +00:00
genericfeatures internal/typeparams: guard against generics in stdlib tests 2021-10-25 20:36:35 +00:00
common.go internal/typeparams: add a generic form of types.AssignableTo 2022-02-08 16:50:25 +00:00
common_test.go internal/typeparams: add a generic form of types.AssignableTo 2022-02-08 16:50:25 +00:00
copytermlist.go internal/typeparams: copy the term list algorithm from go/types 2021-10-14 22:21:32 +00:00
enabled_go117.go Revert "internal/typeparams: hide go1.18 API usage behind a build constraint" 2021-09-28 23:30:19 +00:00
enabled_go118.go Revert "internal/typeparams: hide go1.18 API usage behind a build constraint" 2021-09-28 23:30:19 +00:00
normalize.go go/types/typeutil: add support for mapping generic types 2021-12-02 03:14:37 +00:00
normalize_test.go internal/typeparams: normalize the underlying constraint interface 2021-11-16 01:10:28 +00:00
termlist.go internal/typeparams: copy the term list algorithm from go/types 2021-10-14 22:21:32 +00:00
typeparams_go117.go internal/typeparams: add a generic form of types.AssignableTo 2022-02-08 16:50:25 +00:00
typeparams_go118.go internal/typeparams: add a generic form of types.AssignableTo 2022-02-08 16:50:25 +00:00
typeparams_test.go internal/typeparams: filter out API diffs related to types.Environment 2021-09-29 15:31:12 +00:00
typeterm.go internal/typeparams: copy the term list algorithm from go/types 2021-10-14 22:21:32 +00:00