]> Cypherpunks repositories - gostls13.git/commit
[dev.typeparams] cmd/compile: point StructKeyExpr at the types.Field
authorMatthew Dempsky <mdempsky@google.com>
Fri, 4 Jun 2021 07:01:22 +0000 (00:01 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 4 Jun 2021 21:07:19 +0000 (21:07 +0000)
commita94e4f5a8590e7c8d3aa058fb592561d870285a9
tree90a8c13f2226d37271f5cd6f31535f08044352e5
parentbad388744b57cb49f364971e21d6a2300545f0fb
[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>
src/cmd/compile/internal/ir/expr.go
src/cmd/compile/internal/noder/expr.go
src/cmd/compile/internal/noder/transform.go
src/cmd/compile/internal/staticinit/sched.go
src/cmd/compile/internal/typecheck/expr.go
src/cmd/compile/internal/typecheck/iexport.go
src/cmd/compile/internal/typecheck/iimport.go
src/cmd/compile/internal/walk/closure.go
src/cmd/compile/internal/walk/complit.go