diff options
author | Robert Griesemer <gri@golang.org> | 2021-07-09 13:02:24 -0700 |
---|---|---|
committer | Robert Griesemer <gri@golang.org> | 2021-07-13 04:40:11 +0000 |
commit | 22e926546732e4ea1fb20551be4b91f51f3b6e65 (patch) | |
tree | d2f775b15c81044b86dda4a0cc119255daefecd3 /src/cmd/compile/internal/types2/call.go | |
parent | 1c783dc1480e8dec8bd4e76b744238607ea527f0 (diff) | |
download | go-22e926546732e4ea1fb20551be4b91f51f3b6e65.tar.gz go-22e926546732e4ea1fb20551be4b91f51f3b6e65.zip |
[dev.typeparams] cmd/compile/internal/types2: replace types2.Instantiate with Checker.Instantiate
Allow Checker.Instantiate to work with a nil *Checker receiver
(for now). This opens the door to passing in a *Checker at all
times.
Also, added a verify flag to Instantiate, InstantiateLazy, and
instance, to be able to control if constraint satisfaction should
be checked or not.
Removed types2.Instantiate.
For #47103.
Change-Id: Ie00ce41b3e50a0fc4341e013922e5f874276d282
Reviewed-on: https://go-review.googlesource.com/c/go/+/333569
Trust: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types2/call.go')
-rw-r--r-- | src/cmd/compile/internal/types2/call.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types2/call.go b/src/cmd/compile/internal/types2/call.go index 3377270ef8..0d9637e696 100644 --- a/src/cmd/compile/internal/types2/call.go +++ b/src/cmd/compile/internal/types2/call.go @@ -56,7 +56,7 @@ func (check *Checker) funcInst(x *operand, inst *syntax.IndexExpr) { } // instantiate function signature - res := check.instantiate(x.Pos(), sig, targs, poslist).(*Signature) + res := check.Instantiate(x.Pos(), sig, targs, poslist, true).(*Signature) assert(res.tparams == nil) // signature is not generic anymore if inferred { check.recordInferred(inst, targs, res) @@ -326,7 +326,7 @@ func (check *Checker) arguments(call *syntax.CallExpr, sig *Signature, targs []T } // compute result signature - rsig = check.instantiate(call.Pos(), sig, targs, nil).(*Signature) + rsig = check.Instantiate(call.Pos(), sig, targs, nil, true).(*Signature) assert(rsig.tparams == nil) // signature is not generic anymore check.recordInferred(call, targs, rsig) |