Update the compiler and SDK overlay for nullability and generics in Foundation

We have an SPI between the Swift compiler and Foundation based on the
SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH preprocessor macro that allows us to
request the new API.  rdar://20270080 tracks removing it.

Swift SVN r26475
This commit is contained in:
Dmitri Hrybenko
2015-03-24 02:18:06 +00:00
parent 042dc8e69b
commit ab408d4dc3
18 changed files with 130 additions and 60 deletions

View File

@@ -525,10 +525,10 @@ extension String {
/// Enumerates all the lines in a string.
public func enumerateLines(body: (line: String, inout stop: Bool)->()) {
_ns.enumerateLinesUsingBlock {
(line: String?, stop: UnsafeMutablePointer<ObjCBool>)
(line: String, stop: UnsafeMutablePointer<ObjCBool>)
in
var stop_ = false
body(line: line!, stop: &stop_)
body(line: line, stop: &stop_)
if stop_ {
UnsafeMutablePointer<ObjCBool>(stop).memory = true
}
@@ -588,7 +588,7 @@ extension String {
range: Range<Index>,
options opts:NSStringEnumerationOptions,
_ body: (
substring: String, substringRange: Range<Index>,
substring: String?, substringRange: Range<Index>,
enclosingRange: Range<Index>, inout Bool
)->()
) {
@@ -1046,7 +1046,7 @@ extension String {
/// Returns an array of NSString objects containing, in
/// order, each path component of the `String`.
public var pathComponents: [String] {
return _ns.pathComponents as! [String]
return _ns.pathComponents
}
// @property NSString* pathExtension;