On Jul 18, 2020, at 9:00 PM, Ian Lance Taylor <ia...@golang.org> wrote:
Writing
*Tinstead ofTin a type parameter list changes two things. Let's assume that the type argument at the call site isA, and the constraint isConstraint(this syntax may be used without a constraint, but there is no reason to do so).The first thing that changes is that
Constraintis applied to*Arather thanA. That is,*Amust implementConstraint. It's OK ifAimplementsConstraint, but the requirement is that*Aimplement it.
This seems to work: https://go2goplay.golang.org/p/8veymwXYCoZ
This seems to work: https://go2goplay.golang.org/p/8veymwXYCoZI'm confused. It panics when I run it now.
On Sun, Jul 19, 2020 at 11:43 AM, Jake Montgomery <jake...@gmail.com> wrote:This seems to work: https://go2goplay.golang.org/p/8veymwXYCoZI'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?
panic: I don't know about type main.MyInt!