mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user