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:
However, 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.
cc @ianlancetaylor @dsnet
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:
However, 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.
cc @ianlancetaylor @dsnet