-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
SwiftBaseLibrary/Source/Array.swift
Lines 246 to 260 in 64cb429
| public static func + <T>(lhs: [T], rhs: [T]) -> [T] { | |
| var result = lhs | |
| for i in rhs.GetSequence() { | |
| result.append(i) | |
| } | |
| return result | |
| } | |
| public static func + <T>(lhs: Array<T>, rhs: ISequence<T>) -> Array<T> { | |
| var result = lhs | |
| for i in rhs { | |
| result.append(i) | |
| } | |
| return result | |
| } |
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.
SwiftBaseLibrary/Source/Dictionary.swift
Lines 156 to 162 in 64cb429
| public static func + <T>(lhs: [Key:Value], rhs: [Key:Value]) -> [Key:Value] { | |
| var result = lhs | |
| for k in rhs.keys { | |
| result[k] = rhs[k] | |
| } | |
| return result | |
| } |
Metadata
Metadata
Assignees
Labels
No labels