On 2018-01-13 17:06, Peter Mogensen wrote:
> But I can't really see technical reasons why one could not in principle
> make a language operator, which worked for any interface{..} being of
> type **T for input and *T for output. - and having that compile time
> checked.

Hmm... actually ... no. Unless the restriction is lifted so you can do
method selection via **T on T values and not only on *T, it will not be
possible to be more specific than "interface{}"

Unfortunately (for this) a **T does not satisfy the same interface as
*T. Even though *T satisfies the interfaces of T. You get:

"calling method F with receiver c (type **S) requires explicit dereference"

So - sure... an operator doing static type checking of the
argument/result interface is not directly possible.

/Peter

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to