]> Cypherpunks repositories - gostls13.git/commit
spec: clarify that identical structs must have identical field embeddings
authorRobert Griesemer <gri@golang.org>
Mon, 30 Sep 2024 22:55:14 +0000 (15:55 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 2 Oct 2024 00:57:58 +0000 (00:57 +0000)
commitaa42d7b402ac163ebce141c2805eaf3558252606
tree68b6098b1bae75f06cfb53bb8df69caba15ceef9
parent8c52cd3da550f5315c32bdcb9442ac50e3e4ec96
spec: clarify that identical structs must have identical field embeddings

The existing prose for struct identity did only require that two structs
"have the same sequence of fields, and if corresponding fields have the
same names, and identical types, and identical tags" for the structs to
be identical.

The implementation (forever) has also required that two corresponding
fields are either both embedded or not embedded. This is arguably part
of a struct's structure but is not explicitly specified.

This CL makes a minor change to the prose to address that.

Fixes #69472.

Change-Id: Ifa4ca69717986675642a09d03ce683ba8235efcb
Reviewed-on: https://go-review.googlesource.com/c/go/+/616697
Reviewed-by: Rob Pike <r@golang.org>
TryBot-Bypass: Robert Griesemer <gri@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
doc/go_spec.html