[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:
Dave Abrahams
2014-07-21 20:07:13 +00:00
parent 38e097c4f6
commit 079b5e57ef
10 changed files with 84 additions and 63 deletions

View File

@@ -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
}
}