Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
Cloud the current generic draft constraint a type parameter must be exactly some types
139 views
Skip to first unread message
tapi...@gmail.com
unread,
Sep 18, 2020, 1:06:55 PM
9/18/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
instead of sharing the same underlying types with some types?
Ian Lance Taylor
unread,
Sep 18, 2020, 1:31:10 PM
9/18/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to tapi...@gmail.com, golang-nuts
On Fri, Sep 18, 2020 at 10:07 AM
tapi...@gmail.com
<
tapi...@gmail.com
> wrote:
>
> instead of sharing the same underlying types with some types?
In the current design draft, the answer is yes, but only for
non-predeclared defined types.
https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#type-lists-in-interface-types
Ian
tapi...@gmail.com
unread,
Sep 18, 2020, 1:59:17 PM
9/18/20
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
If sum types are supported can they can be used as general parameter types,
then it is possible to declare overloaded functions/methods demoed in
the end of this article
.
This might be good for some scenarios.
Reply all
Reply to author
Forward
0 new messages