On Sun, Jul 19, 2020 at 11:43 AM, Jake Montgomery <jake6...@gmail.com> wrote:
> This seems to work: https://go2goplay.golang.org/p/8veymwXYCoZ > > > I'm confused. It panics when I run it now. > Since the outcome is probably cached, I'm not sure how that could be the case. Did you mean to respond to Ian's modified version? On Jul 18, 2020, at 9:00 PM, Ian Lance Taylor <i...@golang.org> wrote: > Compare that to https://go2goplay.golang.org/p/8U4h9flkhFN. > The point there is that the argument to the type parameter F is now MyInt instead of int. Since the underlying type is int, this satisfies the Primitive constraint on F. However, the switch in Randomize doesn't handle MyInt, so we hit the default case, which panics. -- 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/CANjmGJuSfqcaUxRYO4PTSKp5S0YvGb_zWnfyWXy6Upj6wBTMUw%40mail.gmail.com.