Presently, you can mark enum cases as @available but it has no impact. Take the 
following example:

enum Things:String {
        @available (iOS 9.3, *) case MobileThing = "com.example.mobilething"
        @available (OSX 10.11, *) case DesktopThing = "com.example.desktopthing"
}

Despite the above compiling, the following code will run iOS with no warnings:

func takesA(thing:Things) {
        print(thing)
}

takesA(.DesktopThing)


Are there enough compelling use-cases for @available on enum cases to be 
considered? At the very least, if @available doesn't do anything on cases, it 
shouldn't be permitted.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to