aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iexport.go
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2021-06-04 00:01:22 -0700
committerMatthew Dempsky <mdempsky@google.com>2021-06-04 21:07:19 +0000
commita94e4f5a8590e7c8d3aa058fb592561d870285a9 (patch)
tree90a8c13f2226d37271f5cd6f31535f08044352e5 /src/cmd/compile/internal/typecheck/iexport.go
parentbad388744b57cb49f364971e21d6a2300545f0fb (diff)
downloadgo-a94e4f5a8590e7c8d3aa058fb592561d870285a9.tar.gz
go-a94e4f5a8590e7c8d3aa058fb592561d870285a9.zip
[dev.typeparams] cmd/compile: point StructKeyExpr at the types.Field
When constructing struct literals, importers need a way to specify precisely which field to initialize without worrying about visibility or those fields being blank. (A blank field doesn't actually need to be initialized, but the expression needs to be evaluated still, and with the right order-of-operations.) This CL changes StructKeyExpr's Field field to point directly to the corresponding types.Field, rather than merely holding a copy of its Sym and Offset. This is akin to past changes to add SelectorExpr.Selection. Change-Id: I95b72b1788f73206fcebc22b456cf6b1186db6a7 Reviewed-on: https://go-review.googlesource.com/c/go/+/325031 Trust: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iexport.go')
-rw-r--r--src/cmd/compile/internal/typecheck/iexport.go5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/cmd/compile/internal/typecheck/iexport.go b/src/cmd/compile/internal/typecheck/iexport.go
index 236f6ed789..3bfbea11c0 100644
--- a/src/cmd/compile/internal/typecheck/iexport.go
+++ b/src/cmd/compile/internal/typecheck/iexport.go
@@ -2062,11 +2062,8 @@ func (w *exportWriter) fieldList(list ir.Nodes) {
for _, n := range list {
n := n.(*ir.StructKeyExpr)
w.pos(n.Pos())
- w.selector(n.Field)
+ w.exoticField(n.Field)
w.expr(n.Value)
- if go117ExportTypes {
- w.uint64(uint64(n.Offset))
- }
}
}