> On Jul 18, 2020, at 9:00 PM, Ian Lance Taylor <i...@golang.org> wrote:
> 
> On Sat, Jul 18, 2020 at 3:43 PM <uluy...@gmail.com> wrote:
>> 
>> This seems to work: https://go2goplay.golang.org/p/8veymwXYCoZ
>> 
>> Still uses interfaces internally.
> 
> Compare that to https://go2goplay.golang.org/p/8U4h9flkhFN.
> 
> Ian

Seems like this should work, but it doesn't:
https://go2goplay.golang.org/p/TtRUrLG0Cdr

The draft says:
> Writing *T instead of T in a type parameter list changes two things. Let's 
> assume that the type argument at the call site is A, and the constraint is 
> Constraint (this syntax may be used without a constraint, but there is no 
> reason to do so).
> 
> The first thing that changes is that Constraint is applied to *A rather than 
> A. That is, *A must implement Constraint. It's OK if A implements Constraint, 
> but the requirement is that *A implement it.
> 

It appears the type constraint is being applied to int instead of *int here.

-- 
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/2DF07ABB-C03D-44D8-BCF2-0C3F76E39A09%40gmail.com.

Reply via email to