On Mon, Apr 22, 2024 at 11:01 PM Jochen Voss <jochen.v...@gmail.com> wrote:
>
> This works, see my code below.  Followup question: is there a way to refer to 
> the new type without having to list both the element type and the pointer 
> type separately?

Unfortunately there is not.  At some point in the future the language
may support type inference for type arguments to types, for cases
where one type argument can be inferred from another type argument.
Currently that is not supported because there are some complex issues
involving cyclical types that need to be resolved or side-stepped.

In Go 1.23 I think it should be possible to simplify using these kinds
of types with a type alias as in "type X[E] = C[E, *E]".

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcXbJXirak2J1GF8Rx0zUvyTXXvwrFZ-RBPd7Jxk5iUe3g%40mail.gmail.com.

Reply via email to