-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: suggest: restrore the "defined type" terminology to "named type". #35091
Comments
@griesemer @robpike how do you think? |
I'm concerned that switching back is only going to increase confusion. I leave this open for now so others can chime in, but there's no urgent need to change this. I agree that defined type is not great, but named type is not great either in the presence of alias types. It is difficult to argue that |
@griesemer Did you mistype I think we can avoid calling aliases as types and only say aliases represents types to rationalize the restore. |
Aliases are definitely types. You can use an alias anywhere you can use any other type. I think that to say that aliases are not types would just make these concepts more complicated. |
@go101 Yes, it should have been |
@ianlancetaylor Comparing to Go 1.8, it is surely a little more complicated. It is hard to get a perfect solution. Personally, I think it is better than the |
As Go 1.18 added back the |
@go101 A |
I understand. After all, the problems mentioned in this issue have gone with the change. |
Since the introduction of type alias, most places of using the old terminology
named type
are changed todefined type
, to avoid some supposed confusions. Now it looks the old terminologynamed type
is intended to be used to represent defined types or type aliases, but this is not confirmed in any official Go document.However, this change brings some embarrassing situations, and causes some inconveniences in explaining some concepts.
IMHO, I think this change is not very necessary. We can re-clarify that if we say
a type alias T is a named type
, we actually meansthe type represented by the alias T is a named type
. IfT
represents an unnamed type, we should never sayT
is a named type, even if the aliasT
itself has a name.If most people think my opinion is reasonable, I think it is still not too late to restrore the
defined type
terminology tonamed type
now, for the terminologydefined type
is still not used widely but the terminologynamed type
is still used widely.In short, the benefits of this suggestion:
The text was updated successfully, but these errors were encountered: