Swift compiler unable to resolve correct overload of + operator for arrays in generic function
问题 I've had several problems with the plus operator so I decided to investigate and ended up with the following minimal example. When I compile func f<T>(t: T) -> [T] { return [t] + [t] } everything is fine. The compiler chooses this overload of the plus operator: public func +<RRC1 : RangeReplaceableCollection, RRC2 : RangeReplaceableCollection where RRC1.Iterator.Element == RRC2.Iterator.Element> (lhs: RRC1, rhs: RRC2) -> RRC1 However, when I add another + to the game, I get this: func f<T>(t: