[SR-2742] Using NS_STRING_ENUM, the init(rawValue:) documentation doesn’t match the code #45346
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Attachment: Download
Environment
Xcode Version 8.0 (8A218a)
Swift 3
macOS Sierra 10.12 (16A323)
Additional Detail from JIRA
md5: 9aa3031d55083c164e1a46097c2e3776
Issue Description:
When using
NS_STRING_ENUM
, I have a type that is defined as follows:Using this type in Swift, I want to attempt to make a key out of a string:
Unfortunately, this fails with the error “Initializer for conditional binding must have Optional type, not 'JKExampleKey'”.
The
init(rawValue: )
method ofJKExampleKey
is not failable—it does not return anOptional
. However, the documentation that appears when I option-click the initializer reads differently:The text was updated successfully, but these errors were encountered: