Groups
Groups
Sign in
Groups
Groups
golang-nuts
Conversations
About
Send feedback
Help
[generics] Typo for type with type argument
140 views
Skip to first unread message
Christian Persson
unread,
Sep 21, 2020, 12:08:57 PM
9/21/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 golan...@googlegroups.com
Hello golang-nuts,
I have found a small typo in the current draft for generics. In the section "Function argument type inference" (
https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#function-argument-type-inference
), there is a function NewPair:
func NewPair[F any](f1, f2 F) *Pair(F) { ... }
The return type should be
*Pair[F]
(brackets instead of parentheses), right?
Kind regards,
Christian Persson
Ian Lance Taylor
unread,
Sep 21, 2020, 1:11:59 PM
9/21/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 Christian Persson, golang-nuts
On Mon, Sep 21, 2020 at 9:08 AM Christian Persson <
chri...@cpersson.se
> wrote:
>
> I have found a small typo in the current draft for generics. In the section "Function argument type inference" (
https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#function-argument-type-inference
), there is a function NewPair:
>
> func NewPair[F any](f1, f2 F) *Pair(F) { ... }
>
> The return type should be *Pair[F] (brackets instead of parentheses), right?
Thanks for catching this. Sent
https://golang.org/cl/256303
to fix it.
Ian
Reply all
Reply to author
Forward
0 new messages