On Tue, Sep 11, 2018 at 2:56 AM, 'Axel Wagner' via golang-nuts <golang-nuts@googlegroups.com> wrote: > > * My post does not allow to constrain on struct fields. This is a > fundamental reduction in power over contracts (type-parameters can't be > identifiers, but only type names so can't solve this like > assignability/convertibility). I don't understand the cases this is needed. > The design doc mentions this at one point. Personally, I find the example a > bit contrived. The examples section contains more realistic use-cases and > I'd find it helpful to get something more in line with that to understand > the need. In either case, this won't ever be possible with a > {pseudo-,}interface based constraint spec, so would require going through > boiler-plate accessor methods (like it does currently with interfaces). > > I CC'ed Larry, as he mentioned that he needs field-accessors.
I'll just note briefly that I tossed field accessors in the contracts design draft because it was easy, not because I thought it was an important feature. It would be interesting to see a real use case for it. At this point I would certainly be fine omitting any way to specify field accessors. 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. For more options, visit https://groups.google.com/d/optout.