aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/importer
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-07-09 13:02:24 -0700
committerRobert Griesemer <gri@golang.org>2021-07-13 04:40:11 +0000
commit22e926546732e4ea1fb20551be4b91f51f3b6e65 (patch)
treed2f775b15c81044b86dda4a0cc119255daefecd3 /src/cmd/compile/internal/importer
parent1c783dc1480e8dec8bd4e76b744238607ea527f0 (diff)
downloadgo-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/importer')
-rw-r--r--src/cmd/compile/internal/importer/iimport.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/importer/iimport.go b/src/cmd/compile/internal/importer/iimport.go
index 14e64891b8..453fa40f2d 100644
--- a/src/cmd/compile/internal/importer/iimport.go
+++ b/src/cmd/compile/internal/importer/iimport.go
@@ -665,7 +665,8 @@ func (r *importReader) doType(base *types2.Named) types2.Type {
baseType := r.typ()
// The imported instantiated type doesn't include any methods, so
// we must always use the methods of the base (orig) type.
- t := types2.Instantiate(pos, baseType, targs)
+ var check *types2.Checker // TODO provide a non-nil *Checker
+ t := check.Instantiate(pos, baseType, targs, nil, false)
return t
case unionType: