aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/importer/iimport.go
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2021-08-05 13:58:24 -0700
committerRobert Griesemer <gri@golang.org>2021-08-06 20:34:52 +0000
commit313924f2726947eb0df5f8fd0462c3a7343f5bc9 (patch)
treeb95e7183bee024b7c564a8a50710981efc348ff4 /src/cmd/compile/internal/importer/iimport.go
parent0d7dc417eaebd35249994bfd5cf211df9bf457c6 (diff)
downloadgo-313924f2726947eb0df5f8fd0462c3a7343f5bc9.tar.gz
go-313924f2726947eb0df5f8fd0462c3a7343f5bc9.zip
[dev.typeparams] cmd/compile: swap export order of union term components (cleanup)
Export a term as a pair (tilde, type) rather than (type, tilde) to match the new Union/Term API. Change-Id: I221c09c2c746ae19fbae0c970ffb26fa7a8ac736 Reviewed-on: https://go-review.googlesource.com/c/go/+/340251 Trust: Robert Griesemer <gri@golang.org> Trust: Dan Scales <danscales@google.com> Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Dan Scales <danscales@google.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/importer/iimport.go')
-rw-r--r--src/cmd/compile/internal/importer/iimport.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cmd/compile/internal/importer/iimport.go b/src/cmd/compile/internal/importer/iimport.go
index 3aab32fc6b..6dd8d595ae 100644
--- a/src/cmd/compile/internal/importer/iimport.go
+++ b/src/cmd/compile/internal/importer/iimport.go
@@ -676,12 +676,9 @@ func (r *importReader) doType(base *types2.Named) types2.Type {
if r.p.exportVersion < iexportVersionGenerics {
errorf("unexpected instantiation type")
}
- nt := int(r.uint64())
- terms := make([]*types2.Term, nt)
+ terms := make([]*types2.Term, r.uint64())
for i := range terms {
- typ := r.typ()
- tilde := r.bool()
- terms[i] = types2.NewTerm(tilde, typ)
+ terms[i] = types2.NewTerm(r.bool(), r.typ())
}
return types2.NewUnion(terms)
}