spec: Interplay between type conversions and embedded structs is not clear. #53975
Labels
NeedsFix
The path to resolution is known, but the work has not been done.
Milestone
The go 1.18 spec seems to disagree with the implementation regarding how type conversions and embedded structs interplay. Specifically:
Results in
However, the spec seems to imply that this should work:
The definition of type identity then says
Finally, the section on struct type says of embedded structs
So, in the case above, the corresponding fields do have the same names and types, which would imply that they are identical and can be converted. I think the definition of type identity should be updated to clarify that corresponding fields must have different "embedded-ness" as well.
The text was updated successfully, but these errors were encountered: