Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
zeeboo
· 1y ago · 0 comments
https://go.dev/doc/faq#generic_methods
Comments
[–]
singron
1y ago
This is a good write-up of the issue. To see where this craziness could have led, see the C++ overload resolution logic, which isn't the exact same problem but does smell the same:
https://en.cppreference.com/w/cpp/language/overload_resoluti...
[–]
wseqyrku
1y ago
I feel there's a clear alternative to the problem presented. I do not expect Empty to match any of those interfaces. A generic method should only match with a generic method of the same arity.
[–]
int_19h
1y ago
This has nothing to do with arity?
[–]
remexre
1y ago
arity as in "number of generic arguments," I think they meant.
[–]
int_19h
1y ago
Still confused then, because there are two sets of generic arguments at play, and a proper call would match the arity of both.