Type aliasing NSStoryboard.Name, NSStoryboard.SceneIdentifier to String is bad and you should feel bad

Originator:tony
Number:rdar://42153449 Date Originated:13 July 2018
Status:Open Resolved:
Product:macOS + SDK Product Version:10.14
Classification:Serious Bug Reproducible:Always
 
Area: AppKit

Summary:

I note that in macOS SDK 10.4 with Swift 4.2, all of the identifier/name items have been typealiased to String.

Why? 

Why this and not conformance to ExpressibleByStringLiteral? 

I have *thousands* of lines of resource extensions that no longer compile due to this change. 

Here's an example:

extension NSStoryboard.Name {
    static let about = "About"
}

extension NSStoryboard.SceneIdentifier {
    static let about = "About"
}

These are no longer their own strong types - they're just Strings, so I can't have the same ID/Name across the types! 

Please reconsider this change - it's a huge step backwards for type safety in all of the frameworks.

Comments


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!