remobjects / SwiftBaseLibrary

Other
92 stars 13 forks source link

Why is array and dictionary + generic when other operators are not? #16

Open sodiboo opened 3 years ago

sodiboo commented 3 years ago

https://github.com/remobjects/SwiftBaseLibrary/blob/64cb42958c324910e33789b38179f0b19f1ffbd2/Source/Array.swift#L246-L260

These two definitions for + are generic, but the other operators are not. The other operators can still use the generic type parameter from the array type itself, why does the + use its own generic type parameter? Same thing for Dictionary.

https://github.com/remobjects/SwiftBaseLibrary/blob/64cb42958c324910e33789b38179f0b19f1ffbd2/Source/Dictionary.swift#L156-L162