Skip to content

Removed uses of deprecated @warn_unused_result attr #393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions Foundation/NSCoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public class NSCoder : NSObject {
NSRequiresConcreteImplementation()
}

@warn_unused_result
public func decodeObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) -> DecodedObjectType? {
NSUnimplemented()
}
Expand All @@ -62,22 +61,18 @@ public class NSCoder : NSObject {
be casted to NSObject, nor is it Hashable.
*/
/// - Experiment: This is a draft API currently under consideration for official import into Foundation
@warn_unused_result
public func decodeObjectOfClasses(_ classes: [AnyClass], forKey key: String) -> AnyObject? {
NSUnimplemented()
}

@warn_unused_result
public func decodeTopLevelObject() throws -> AnyObject? {
NSUnimplemented()
}

@warn_unused_result
public func decodeTopLevelObjectForKey(_ key: String) throws -> AnyObject? {
NSUnimplemented()
}

@warn_unused_result
public func decodeTopLevelObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) throws -> DecodedObjectType? {
NSUnimplemented()
}
Expand All @@ -93,7 +88,6 @@ public class NSCoder : NSObject {
be casted to NSObject, nor is it Hashable.
*/
/// - Experiment: This is a draft API currently under consideration for official import into Foundation
@warn_unused_result
public func decodeTopLevelObjectOfClasses(_ classes: [AnyClass], forKey key: String) throws -> AnyObject? {
NSUnimplemented()
}
Expand Down
2 changes: 0 additions & 2 deletions Foundation/NSError.swift
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ public protocol __BridgedNSError : RawRepresentable, ErrorProtocol {
static var __NSErrorDomain: String { get }
}

@warn_unused_result
public func ==<T: __BridgedNSError where T.RawValue: SignedInteger>(lhs: T, rhs: T) -> Bool {
return lhs.rawValue.toIntMax() == rhs.rawValue.toIntMax()
}
Expand All @@ -216,7 +215,6 @@ public extension __BridgedNSError where RawValue: SignedInteger {
public final var hashValue: Int { return _code }
}

@warn_unused_result
public func ==<T: __BridgedNSError where T.RawValue: UnsignedInteger>(lhs: T, rhs: T) -> Bool {
return lhs.rawValue.toUIntMax() == rhs.rawValue.toUIntMax()
}
Expand Down
6 changes: 0 additions & 6 deletions Foundation/NSKeyedUnarchiver.swift
Original file line number Diff line number Diff line change
Expand Up @@ -643,27 +643,22 @@ public class NSKeyedUnarchiver : NSCoder {
return nil
}

@warn_unused_result
public override func decodeObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) -> DecodedObjectType? {
return decodeObjectOfClasses([cls], forKey: key) as? DecodedObjectType
}

@warn_unused_result
public override func decodeObjectOfClasses(_ classes: [AnyClass], forKey key: String) -> AnyObject? {
return _decodeObjectOfClasses(classes, forKey: key)
}

@warn_unused_result
public override func decodeTopLevelObjectForKey(_ key: String) throws -> AnyObject? {
return try decodeTopLevelObjectOfClasses([NSArray.self], forKey: key)
}

@warn_unused_result
public override func decodeTopLevelObjectOfClass<DecodedObjectType : NSCoding where DecodedObjectType : NSObject>(_ cls: DecodedObjectType.Type, forKey key: String) throws -> DecodedObjectType? {
return try self.decodeTopLevelObjectOfClasses([cls], forKey: key) as! DecodedObjectType?
}

@warn_unused_result
public override func decodeTopLevelObjectOfClasses(_ classes: [AnyClass], forKey key: String) throws -> AnyObject? {
guard self._containers?.count == 1 else {
throw _decodingError(NSCocoaError.CoderReadCorruptError,
Expand Down Expand Up @@ -894,7 +889,6 @@ public class NSKeyedUnarchiver : NSCoder {
}

extension NSKeyedUnarchiver {
@warn_unused_result
public class func unarchiveTopLevelObjectWithData(_ data: NSData) throws -> AnyObject? {
var root : AnyObject? = nil

Expand Down
1 change: 0 additions & 1 deletion Foundation/NSRange.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ extension NSRange {
length = x.count
}

@warn_unused_result
public func toRange() -> CountableRange<Int>? {
if location == NSNotFound { return nil }
let min = location
Expand Down
1 change: 0 additions & 1 deletion Foundation/NSSwiftRuntime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ public protocol _ObjectTypeBridgeable {
associatedtype _ObjectType : AnyObject

/// Convert `self` to an Object type
@warn_unused_result
func _bridgeToObject() -> _ObjectType

/// Bridge from an object of the bridged class type to a value of
Expand Down
Loading