[generics] go vet -generic flag

80 views
Skip to first unread message

Gert

unread,
Jun 18, 2020, 3:29:57 AM6/18/20
to golang-nuts
As far as I can tell there are already a lot of closed working as intended tickets related to

https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#using-generic-types-as-unnamed-function-parameter-types

My suggestion is to be more proactive about this specific problem as soon as consensus is reached by introducing a `go vet -generic` flag that does nothing more then just highlight this specific very rare problem. And introduce this small language change now so it's more than a year in advance in place.

The concern I think will come forward is when we don't give it a high enough priority early enough it will significantly handicap the generic error compiler messages if we don't be concrete about it?

Ian Lance Taylor

unread,
Jun 19, 2020, 1:07:31 AM6/19/20
to Gert, golang-nuts
That sounds like a good plan, if we decide to proceed with this syntax. Thanks.

Ian
Reply all
Reply to author
Forward
0 new messages