On Wed, Jul 1, 2020 at 9:39 AM <aurelien.rain...@gmail.com> wrote:
>
> Is this expected?
>
> import "list" // for 'std' list.go2
>
> func main() {
> type intElement list.Element(int)
> _ = make(map[int]intElement) // ok: compiles
>
> // nok
> _ = make(map[int]list.Element(int)) // cannot use generic type 
> list.Element(type TElem) without instantiation
> }
>
> I don't think it is, but in case it is, how would I instantiate a 
> make(map[int]intElement) without having to typedef a generic type before.

>From the parser's perspective the argument to make is an expression,
so in this case you need parentheses to keep this from looking like a
type conversion.

make(map[int](list.Element(int)))

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/CAOyqgcWnp2hEBU1tSgv1AAKgZ%3D7GJ1B7qkqJg%2BZ9iyvxPwCcHg%40mail.gmail.com.

Reply via email to