[swift-users] Is there any talk about overloading enum cases with associated values?

Adrian Zubarev adrian.zubarev at devandartist.com
Fri Nov 25 05:37:02 CST 2016


I’m trying to find any talk on the evolution list about the overloading of enum cases with associated values.

Has this already been discussed?
Any technical reasons why we don’t have this already?
Anyone else would want this feature?
enum MyEnum {
     
    case a.     // <—\
                //   | should not be allowed!?
    case a(Int) // <—/
     
    // What I want is this:
    case javaScript(String)
    case javaScript(String, scope: Document)  
    // instead of `case scopedJavascript(String, scope: Document)`
}
Best regards,



-- 
Adrian Zubarev
Sent with Airmail
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20161125/5356a02b/attachment.html>


More information about the swift-users mailing list