+1 nested types in protocols
And nested protocols in types.

-1 on throwing properties.


> On Oct 7, 2016, at 10:30 AM, Cao Jiannan via swift-evolution 
> <[email protected]> wrote:
> 
> 1. allow embed type declaration in protocol
> e.g.:
> 
> protocol URLProvider {
>    fun url() throws -> URL
> }
> 
> extension URLProvider {
>    enum Error: Swift.Error {
>         invalidBaseURL
>         invalidPath
>         invalidQuery
>         invalidFragment
>    }
> }
> 
> 
>     func parseURL() throws -> URL {
>        throw URLProvider.Error.invalidBaseURL
>    }
> 
> 2. allow throw in property getter/setter
> 
> e.g.:
> 
> struct myURLProvider: URLProvider {
>    var url: throws -> URL {
>       try URL(baseURL: baseURL, path: path, query: query, fragment: fragment)
>    }
> }
> 
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to