type parameters and named type

70 views
Skip to first unread message

Jianwei Xie

unread,
Mar 20, 2022, 12:12:26 PM3/20/22
to golang-nuts
Hi there. 

I am reading go spec. When hit the "Types" section, 


it stated "Predeclared types, defined types, and type parameters are called named types."

I wonder why "type parameters" is "named type". To find the definition of this term, I found section 


As quoted, "A type parameter list declares the type parameters of a generic function or type declaration. ". My interpretation is: type parameters itself is not a type, but a list of type parameters. 

Thanks

tapi...@gmail.com

unread,
Mar 20, 2022, 12:37:56 PM3/20/22
to golang-nuts
> type parameters itself is not a type, but a list of type parameters.

true. The spec means a single type parameter is a named type.
Reply all
Reply to author
Forward
0 new messages