News for hackers. Stuff that matters.
Re:Generics facilitators in Go by crtc on Wednesday December 22, 2021 @06:04PM (#29656621)
> No mention of why they left them out in non-interface types.

Actually it does:

"Or, we could decide that parameterized methods do not, in fact, implement interfaces, but then it's much less clear why we need methods at all. If we disregard interfaces, any parameterized method can be implemented as a parameterized function."

https://go.googlesource.com/proposal/+/refs/heads/master/des...

Re:Generics facilitators in Go by erik_seaberg on Wednesday December 22, 2021 @09:36PM (#29658020)
Except that reflection-based tools work with methods but not functions.
Re:Generics facilitators in Go by crtc on Thursday December 23, 2021 @02:52AM (#29659634)
Yes, but reflection is part of the problem:

"And even that traversal is not sufficient in the general case when type reflection gets involved, as reflection might look up methods based on strings input by the user. So in general instantiating parameterized methods in the linker might require instantiating every parameterized method for every possible type argument, which seems untenable."

So methods with type parameters would a) not be usable with interfaces and b) not be usable with reflection.