proposal: Add member access to structure generics #73013
Labels
LanguageChange
Suggested changes to the Go language
LanguageChangeReview
Discussed by language change review committee
Proposal
Milestone
Go Programming Experience
Experienced
Other Languages Experience
C/C++, JavaScript
Related Idea
Has this idea, or one like it, been proposed before?
No
Does this affect error handling?
No
Is this about generics?
Yes.
~[]E
) can have its member accessed, but not struct type.Proposal
Allow mamber access for generic struct type values.
Language Spec Changes
This will allow mamber access for generic struct type values.
Informal Change
No response
Is this change backward compatible?
Yes. This is a brand-new concept, and nothing older is affected.
Orthogonality: How does this change interact or overlap with existing features?
Generic struct types.
Would this change make Go easier or harder to learn, and why?
Easier. The error "r.Pix undefined (type I has no field or method Pix)" will not exist anymore.
Cost Description
Nearly no cost.
Changes to Go ToolChain
0
Performance Costs
Not measured
Prototype
No response
The text was updated successfully, but these errors were encountered: