]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: consider generic functions in inference simplify step
authorRobert Griesemer <gri@golang.org>
Thu, 4 May 2023 04:34:25 +0000 (21:34 -0700)
committerGopher Robot <gobot@golang.org>
Thu, 4 May 2023 17:35:06 +0000 (17:35 +0000)
commit13201d57283e3684ab46ccb5ee0bb6b3fe67c221
tree4c84e9936be53d3734967abeeb14aa904dcbd6ac
parent60c724c55a5cc9925e63c5b8383f6d24ae06a658
go/types, types2: consider generic functions in inference simplify step

After type arguments for all type parameters have been determined,
the type arguments are "simplified" by substituting any type parameters
that might occur in them with their corresponding type arguments until
all type parameters have been removed.

If in this process a (formerly) generic function signature becomes
non-generic, make sure to nil out its (declared) type parameters.

Fixes #59953.
For #59338.

Change-Id: Ie16bffd7b0a8baed18e76e5532cdfaecd26e4278
Reviewed-on: https://go-review.googlesource.com/c/go/+/491797
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>
Auto-Submit: Robert Griesemer <gri@google.com>
src/cmd/compile/internal/types2/infer.go
src/go/types/infer.go
src/internal/types/testdata/fixedbugs/issue59953.go [new file with mode: 0644]