On Mon, Apr 22, 2024 at 11:01 PM Jochen Voss <
joche...@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