Auto-bridged ErrorType domain string lacks nullability

Originator:robnapier
Number:rdar://22917151 Date Originated:Sep 30, 2015
Status: Resolved:
Product:Swift Product Version:7.0.1
Classification: Reproducible:
 
Given an objc-bridged enum ErrorType:

/// Errors thrown by `CryptorType`
@objc public enum RNCryptorError: Int, ErrorType {
    /// Ciphertext was corrupt or password was incorrect.
    /// It is not possible to distinguish between these cases in the v3 data format.
    case HMACMismatch = 1

    /// Unrecognized data format. Usually this means the data is corrupt.
    case UnknownHeader

    /// `final()` was called before sufficient data was passed to `updateWithData()`
    case MessageTooShort

    /// Memory allocation failure. This should never happen.
    case MemoryFailure

    /// A password-based decryptor was used on a key-based ciphertext, or vice-versa.
    case InvalidCredentialType
}

---

The compiler generates the following domain string for ObjC:

static NSString * const RNCryptorErrorDomain = @"RNCryptor.RNCryptorError";


This leads to a warning:

Pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified)

Comments

Yep, I've noticed the same thing. Also filed my own bug report with apple over a week ago, haven't heard back yet.

By srscottrobbins at Oct. 1, 2015, 5:36 a.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!