[swift-evolution] Require parameter names for ENUM Associated Types?

Adrian Zubarev adrian.zubarev at devandartist.com
Tue Nov 29 10:35:14 CST 2016


If we’re talking about non optional values here, then I don’t produce a possible expensive copy of my associated values (sure it depends on the type, COW etc.), but that’s my main point for excluding the the associated values.

Somewhere in my code I also have a semi schema subscript which evaluates the enum case like this:

if case .double = $0 { return true } else { return false }
There is just no better way for this check. I wish I could write something like return .double ~= $0 there.



-- 
Adrian Zubarev
Sent with Airmail

Am 29. November 2016 um 17:19:16, Tony Allevato (allevato at google.com) schrieb:

I suppose I'm not seeing why it's important to exclude the associated values from pattern matching. What do you gain except saving a few characters?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20161129/3d111dcd/attachment.html>


More information about the swift-evolution mailing list