3 ms·
To be fair to the author of the article, the official Go blog, written by Go's designers, offers the same explanation as the article, unfortunately.
by tsimionescu 7y ago
To be fair to the author of the article, the official Go blog, written by Go's designers, offers the same explanation as the article, unfortunately.
- erik_seaberg 7y agoThere was a proposal https://github.com/golang/go/issues/7512 https://github.com/golang/go/issues/7512 to make interface method return types covariant, but it didn't go anywhere, and people seemed to favor the broken behavior (returning a concrete type can fail to satisfy an interface, because the crude matching doesn't care that the type has all the expected methods).