<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">This was deliberate, and came from the pain of bringing up tvOS (and watchOS). Clang actually had a hack to treat “available on iOS” as “available on tvOS” for a while because of this. When you port something to a new platform, presumably everything that’s been introduced so far should be available from the start.</div><div class=""><br class=""></div><div class="">If we introduced a limited availability attribute, I think we’d want to make it <i class="">more</i> verbose than the normal one, so that you know you’re choosing it.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On May 25, 2016, at 20:18, Jacob Bandes-Storch <<a href="mailto:jtbandes@gmail.com" class="">jtbandes@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Was this an intentional choice, or is it just a temporary limitation? Would a proposal to allow something like "@available(OS X 10.11)" be welcomed?<div class="gmail_extra"><div class=""><div class="gmail_signature"><div dir="ltr" class=""><div class=""><br class=""></div></div></div></div>
<br class=""><div class="gmail_quote">On Wed, May 25, 2016 at 8:17 PM, Jordan Rose via swift-evolution <span dir="ltr" class=""><<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class=""><div class="">The “*” in @available means “all other platforms”. If you want to mark something <i class="">unavailable</i> on a particular platform, you’ll have to use the long form of the @available attribute. There’s currently no way to mark something “only available on these platforms”.</div><div class=""><br class=""></div><div class="">Jordan</div><br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On May 25, 2016, at 18:48, Stuart Breckenridge via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div style="word-wrap:break-word" class="">Presently, you can mark enum cases as <font face="Menlo" class="">@available</font> but it has no impact. Take the following example:<div class=""><br class=""></div><div class=""><font face="Menlo" class="">enum Things:String {</font></div><div class=""><font face="Menlo" class=""><span style="white-space:pre-wrap" class="">        </span>@available (iOS 9.3, *) case MobileThing = "com.example.mobilething"</font></div><div class=""><font face="Menlo" class=""><span style="white-space:pre-wrap" class="">        </span>@available (OSX 10.11, *) case DesktopThing = "com.example.desktopthing"</font></div><div class=""><font face="Menlo" class="">}</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">Despite the above compiling, the following code will run iOS with no warnings:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">func takesA(thing:Things) {</font></div><div class=""><font face="Menlo" class=""><span style="white-space:pre-wrap" class="">        </span>print(thing)</font></div><div class=""><font face="Menlo" class="">}</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">takesA(.DesktopThing)</font></div><div class=""><br class=""></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class="">Are there enough compelling use-cases for @available on enum cases to be considered? At the very least, if <font face="Menlo" class="">@available</font> doesn't do anything on cases, it shouldn't be permitted.</div></div></div></div>_______________________________________________<br class="">swift-evolution mailing list<br class=""><a href="mailto:swift-evolution@swift.org" target="_blank" class="">swift-evolution@swift.org</a><br class=""><a href="https://lists.swift.org/mailman/listinfo/swift-evolution" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class=""></div></blockquote></div><br class=""></div><br class="">_______________________________________________<br class="">
swift-evolution mailing list<br class="">
<a href="mailto:swift-evolution@swift.org" class="">swift-evolution@swift.org</a><br class="">
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank" class="">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br class="">
<br class=""></blockquote></div><br class=""></div></div>
</div></blockquote></div><br class=""></body></html>