Hacker News new | ask | show | jobs
by wseqyrku 450 days 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.
1 comments

This has nothing to do with arity?
arity as in "number of generic arguments," I think they meant.
Still confused then, because there are two sets of generic arguments at play, and a proper call would match the arity of both.
Yeah, it would be that plus the name and the signature as per usual. I don't think this is a huge limitation considering the alternative they chose: disallow generic methods altogether.
So how would you implement generic method calls via an interface reference?
The same way the other languages do it.