-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.genericsIssue is related to genericsIssue is related to generics
Milestone
Description
The motivation behind type aliases was the ability to refer under a new name to a thing that exists elsewhere. Prior to generics, functions can be easily re-referred to using assignment:
var Cut = strings.CutHowever, doing the same thing with a generic function fails with error message "cannot use generic function F without instantiation". It is possible to define a wrapper function, but that requires copy/pasting the entire function signature.
It'd be nice if the plain assignment worked.
I understand that this probably raises non-trivial spec difficulties. I just wanted to flag it as a useful thing.
I imagine this is a dupe, but I couldn't find it.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.genericsIssue is related to genericsIssue is related to generics