I don't care for the (type T Equaler) example. It makes one thing look
like another.
The rest seems interesting. Obviating and generalizing the * syntax is
certainly promising and a nice justification for type lists.
Would the constraints package have Pointer[E], Slice[E], and so on?
What happens if you have
type SC(type E I) interface {
type []E
}
for some I? Generally it seems like something to avoid, but it would
be needed for
type Map[type K comparable, V interface{}] interface {
type map[K]V
}
at least. Are those checked at the same time as methods?
Do chains of constraints like
func F[type T interface{}, PT Setter2[T], SPT SC[PT]](xs SPT) SPT
func G[type T interface{}, PT Setter2[T], S0 SC[T], S1[PT]](xs S0) S1
work?
On Wed, Aug 12, 2020 at 7:31 PM Ian Lance Taylor <[email protected]> wrote:
>
> I just added a new section to the generics design draft describing
> constraint type inference. This is a generalization and
> simplification of the earlier pointer method approach, which has now
> been removed. I would be happy to hear any comments. Thanks.
>
> https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#constraint-type-inference
>
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/CAOyqgcX6AcGUt4e6JTMrxXkAtMRq%2Bo6zSVnjqchEroheYBP%2BBw%40mail.gmail.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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/CANG3jXJme%2BL5FQ5sg600Wi7JORPbSAU%2B%3DG8BN590pnVG859W%2Bg%40mail.gmail.com.