[go] types2: implement arbitrary field selectors for struct literals

4 views
Skip to first unread message

Robert Griesemer (Gerrit)

unread,
Mar 6, 2026, 12:47:29 AM (14 days ago) Mar 6
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Robert Griesemer uploaded new patchset

Robert Griesemer uploaded patch set #3 to this change.
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 3
Gerrit-Owner: Robert Griesemer <g...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 6, 2026, 12:51:20 AM (14 days ago) Mar 6
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com

Robert Griesemer voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 3
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Comment-Date: Fri, 06 Mar 2026 05:51:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 7, 2026, 12:21:49 AM (13 days ago) Mar 7
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Robert Griesemer

Robert Griesemer uploaded new patchset

Robert Griesemer uploaded patch set #4 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Robert Griesemer
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 4
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Attention: Robert Griesemer <g...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 7, 2026, 12:40:51 AM (13 days ago) Mar 7
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Robert Griesemer

Robert Griesemer uploaded new patchset

Robert Griesemer uploaded patch set #5 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Robert Griesemer
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 5
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 7, 2026, 12:43:30 AM (13 days ago) Mar 7
to goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com

Robert Griesemer voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 5
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Comment-Date: Sat, 07 Mar 2026 05:43:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 9, 2026, 5:15:19 PM (10 days ago) Mar 9
to goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com

Robert Griesemer voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 6
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Comment-Date: Mon, 09 Mar 2026 21:15:15 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 9, 2026, 5:51:35 PM (10 days ago) Mar 9
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Robert Griesemer

Robert Griesemer uploaded new patchset

Robert Griesemer uploaded patch set #7 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Robert Griesemer
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 7
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Attention: Robert Griesemer <g...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 9, 2026, 5:54:17 PM (10 days ago) Mar 9
to goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com

Robert Griesemer voted and added 1 comment

Votes added by Robert Griesemer

Commit-Queue+1

1 comment

Patchset-level comments
File-level comment, Patchset 7 (Latest):
Robert Griesemer . resolved

Failure is unrelated. Trying trybots once more.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 7
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Comment-Date: Mon, 09 Mar 2026 21:54:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 16, 2026, 7:00:56 PM (3 days ago) Mar 16
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Robert Griesemer

Robert Griesemer uploaded new patchset

Robert Griesemer uploaded patch set #10 to this change.
Open in Gerrit

Related details

Attention is currently required from:
  • Robert Griesemer
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 10
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Attention: Robert Griesemer <g...@google.com>
unsatisfied_requirement
satisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
Mar 16, 2026, 7:03:42 PM (3 days ago) Mar 16
to goph...@pubsubhelper.golang.org, Mark Freeman, Go LUCI, golang-co...@googlegroups.com
Attention needed from Mark Freeman

Robert Griesemer voted

Code-Review+1
Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Mark Freeman
Submit Requirements:
  • requirement is not satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 10
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Attention: Mark Freeman <markf...@google.com>
Gerrit-Comment-Date: Mon, 16 Mar 2026 23:03:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
unsatisfied_requirement
satisfied_requirement
open
diffy

Mark Freeman (Gerrit)

unread,
Mar 18, 2026, 3:01:07 PM (yesterday) Mar 18
to Robert Griesemer, goph...@pubsubhelper.golang.org, Go LUCI, golang-co...@googlegroups.com
Attention needed from Robert Griesemer

Mark Freeman voted and added 1 comment

Votes added by Mark Freeman

Code-Review+2

1 comment

File src/internal/types/testdata/spec/structLits.go
Line 34, Patchset 10 (Latest): _ = A{B: B{}, b /* ERROR "" */ : 0}
Mark Freeman . unresolved

Is this intentional? Should it be moved closer to the case on the bottom? They are somewhat inverses of each other.

Open in Gerrit

Related details

Attention is currently required from:
  • Robert Griesemer
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 10
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Attention: Robert Griesemer <g...@google.com>
Gerrit-Comment-Date: Wed, 18 Mar 2026 19:01:02 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
5:08 PM (5 hours ago) 5:08 PM
to goph...@pubsubhelper.golang.org, golang-co...@googlegroups.com
Attention needed from Robert Griesemer

Robert Griesemer uploaded new patchset

Robert Griesemer uploaded patch set #11 to this change.
Following approvals got outdated and were removed:
  • TryBots-Pass: LUCI-TryBot-Result-1 by Go LUCI
Open in Gerrit

Related details

Attention is currently required from:
  • Robert Griesemer
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newpatchset
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 11
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
5:09 PM (5 hours ago) 5:09 PM
to goph...@pubsubhelper.golang.org, Mark Freeman, Go LUCI, golang-co...@googlegroups.com

Robert Griesemer voted and added 1 comment

Votes added by Robert Griesemer

Code-Review+1
Commit-Queue+1

1 comment

File src/internal/types/testdata/spec/structLits.go
Line 34, Patchset 10: _ = A{B: B{}, b /* ERROR "" */ : 0}
Mark Freeman . resolved

Is this intentional? Should it be moved closer to the case on the bottom? They are somewhat inverses of each other.

Robert Griesemer

Good catch - oversight. Fixed.

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
  • requirement is not satisfiedTryBots-Pass
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 11
Gerrit-Owner: Robert Griesemer <g...@google.com>
Gerrit-Reviewer: Mark Freeman <markf...@google.com>
Gerrit-Reviewer: Robert Griesemer <g...@google.com>
Gerrit-Comment-Date: Thu, 19 Mar 2026 21:09:14 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: Mark Freeman <markf...@google.com>
satisfied_requirement
unsatisfied_requirement
open
diffy

Robert Griesemer (Gerrit)

unread,
5:32 PM (5 hours ago) 5:32 PM
to goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Go LUCI, Mark Freeman, golang-co...@googlegroups.com

Robert Griesemer submitted the change with unreviewed changes

Unreviewed changes

10 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: src/internal/types/testdata/spec/structLits.go
Insertions: 1, Deletions: 1.

@@ -31,9 +31,9 @@
_ = A{A /* ERROR "unknown field A in struct literal of type A, but does have a" */ : 0}
_ = A{X /* ERROR "unknown field X in struct literal of type A, but does have x" */ : 0}
_ = A{a: 0, b: 0, c: 0}
- _ = A{B: B{}, b /* ERROR "" */ : 0}
_ = A{x /* ERROR "pointer indirection" */ : 0}
_ = B{b: 0, c: 0, x: 0, y: 0, z: 0}
_ = B{C: C{}, x /* ERROR "cannot specify promoted field x and enclosing embedded field C" */ : 0}
_ = A{b: 0, B /* ERROR "cannot specify embedded field B and enclosed promoted field b" */ : B{}}
+ _ = A{B: B{}, b /* ERROR "cannot specify promoted field b and enclosing embedded field B" */ : 0}
)
```

Change information

Commit message:
go/types, types2: allow promoted field names as keys in struct literals

For #9859.
Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Reviewed-by: Mark Freeman <markf...@google.com>
Reviewed-by: Robert Griesemer <g...@google.com>
Files:
  • M src/cmd/compile/internal/types2/literals.go
  • M src/cmd/compile/internal/types2/lookup.go
  • M src/go/types/literals.go
  • M src/go/types/lookup.go
  • M src/internal/types/testdata/check/expr3.go
  • A src/internal/types/testdata/spec/structLits.go
  • M test/fixedbugs/issue23609.go
  • M test/fixedbugs/issue26416.go
Change size: M
Delta: 8 files changed, 144 insertions(+), 57 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Mark Freeman, +1 by Robert Griesemer
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: go
Gerrit-Branch: master
Gerrit-Change-Id: Ie4823e726ab43fe2ce1e96c279f63dad6c1f9873
Gerrit-Change-Number: 751702
Gerrit-PatchSet: 12
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages