Closed leabit closed 1 month ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
Al right, it looks like the same issue was already mentioned in #22005, however, nothing has been done for 7 years
Duplicate of #22005
What is the URL of the page with the issue?
https://go.dev/ref/spec#Struct_types
What is your user agent?
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36
Screenshot
No response
What did you do?
I came across a discussion about the incorrect terminology used in the specification when referring to promoted methods of the alias to unnamed type, and the changes that were made to address this issue. However, there remains another related problem, and I believe its resolution should also be considered as part of the overall solution. The specification states the following:
If the type name denotes only defined types everything would be fine, however, it also denotes type alias to the unnamed (undefined) types.
What did you see happen?
So according to the specification, the following code is invalid since type name
T
is a pointer type:However, it compiles.
What did you expect to see?
To not compile (actually to compile, but to correct the specification to properly address this as well).