]> Cypherpunks repositories - gostls13.git/commit
go/types, types2: control type inference in Checker.funcInst via infer argument
authorRobert Griesemer <gri@golang.org>
Tue, 9 May 2023 22:40:36 +0000 (15:40 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 10 May 2023 15:42:07 +0000 (15:42 +0000)
commitf30cd520516037b2fdb367ddd8e0851019bf3440
treeb88246fc7e921412b66f0f83eb1cb2177a4d7240
parent93d9035c9e8b129578d3a177fd90eb308e44a597
go/types, types2: control type inference in Checker.funcInst via infer argument

If the infer argument is true, funcInst behaves as before.
If infer is false and there are not enough type arguments,
rather then inferring the missing arguments and instantiating
the function, funcInst returns the found type arguments.

This permits the use of funcInst (and all the checks it does)
to collect the type arguments for partially instantiated
generic functions used as arguments to other functions.

For #59338.

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