On Sat, Jun 20, 2020 at 12:08 PM David Finkel <david.fin...@gmail.com> wrote:
>
> Here's an almost working example:
> https://go2goplay.golang.org/p/qcdfl0tuHlb
>
> It looks like there's a bug in the type-parameter constraint checking because 
> in the above example code, I get:
>
> type checking failed for main
>
> prog.go2:11:39: K does not satisfy comparable
>
> This, despite the type parameter definition literally requiring that K be 
> comparable:
> func genLen(type T MapSliceConstraint(K, V), K comparable, V 
> interface{})(collection T) int {
>         return len(collection)
> }
> (example without a main() to reduce clutter: 
> https://go2goplay.golang.org/p/1gqiYuDELuI)

Yes, that looks like a bug.  Would you mind filing it in the issue
tracker?  Thanks.

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/CAOyqgcXtxovhoGiSkyMFHjtfMGCKmYk1bXbZtWFZj4fegEaV1Q%40mail.gmail.com.

Reply via email to