On Wed, Jun 17, 2020 at 5:18 PM Randall O'Reilly wrote:
>
> Good point!
>
> I can think of 2 possible (non-mutex) solutions:
>
> * Use an explicit type expression to refer to the type: `type(ms.T)` and the
> field is just `ms.T`
>
> * Within the method scope, make `T` a valid type name, so you
Good point!
I can think of 2 possible (non-mutex) solutions:
* Use an explicit type expression to refer to the type: `type(ms.T)` and the
field is just `ms.T`
* Within the method scope, make `T` a valid type name, so you can just use `T`
directly -- this might even be preferable overall as it
I think this syntax could get confusing when embedded fields is added to
the mix:
type MyStruct(type T) struct {
T
}
func (ms *MyStruct) MyMethod(t ms.T) {
ms.T = t
}
In this example. ms.T means two very different things depending on where
they are used.
On Wed, Jun 17, 2020 at 3:45