If I understand right the panic is because the `m := NewMap[string,
int]` is a function not a function call and after that you try to
assign to this function `m[int]`. This
works https://go2goplay.golang.org/p/NOaPH-dJyWd .
On Tue, 2021-01-05 at 08:10 -0800, Brian Candler wrote:
> I don't know if this is expected, but this (bad) program causes the
> go2go playground to give "panic: assertion failed"
> 
> https://go2goplay.golang.org/p/VH5SLJNxw3X
> 
> - I think it's the compiler itself that's panicing, not the runtime
> (since it doesn't get as far as the next line).
> 
> ----
> 
> Aside: my general feeling so far is that the error messages given
> from go programs which misapply generic syntax can be very
> unhelpful.  Here's one example:
> https://go2goplay.golang.org/p/m9YUDBTWwpA
> 
> Error given: "missing ',' in type argument list"
> Actual problem: a constraint was used in a place where it's not
> allowed
> -- 
> 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/aa0acea2-7e52-457b-b22f-92f0e19bf922n%40googlegroups.com
> .

-- 
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/3c1ea2f3aa5d9483a876fcc01b131ae3c438fff5.camel%40gmail.com.

Reply via email to