mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[stdlib] += no longer appends array elements
+= only extends arrays with another sequence of the same element type. Fixes <rdar://problem/17151420> The use of the overloaded += operator in Swift is inconsistent and confusing with Arrays. Note that this commits generated 3 new radars against the type checker: <rdar://problem/17751308> <rdar://problem/17750582> <rdar://problem/17751359> Swift SVN r20274
This commit is contained in:
@@ -153,7 +153,7 @@ extension String {
|
||||
var result = ContiguousArray<UTF8.CodeUnit>()
|
||||
result.reserveCapacity(countElements(utf8) + 1)
|
||||
result += utf8
|
||||
result += 0
|
||||
result.append(0)
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user