[swift-users] still wrestling with a type conversion problem

Jacob Bandes-Storch jtbandes at gmail.com
Tue Jul 4 19:48:13 CDT 2017


On Tue, Jul 4, 2017 at 7:21 AM, David Baraff <davidbaraff at gmail.com> wrote:

>
>     func decoded(_ input: Any) -> Set {
>         if let listVal = input as? [Set.Element] {
>             return Set(listVal)
>         }
>         return self
>     }
>
>
This looks a little weird — what is `self` here? It might be more
appropriate to use a `static func` or even a failable `init?`.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170704/25c5169f/attachment.html>


More information about the swift-users mailing list