On Sat, Jun 27, 2020 at 12:35 PM a b <tanc13ya...@gmail.com> wrote:
>
> Newtype is a expression like
> type MyInt int
>
> It's not the same type as int, so why it's permitted?
> In Go1 you must perform explicit conversion.

Because if you have a []MyInt, it would be nice to be able to pass
that to a function like slices.Min.  Note that you can't directly
convert []MyInt to []int.

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/CAOyqgcUzF41ifiDHN6mrLpiHxz%2BhnkZKzCpTX8SAB_PHHJhJ-Q%40mail.gmail.com.

Reply via email to