> On Aug 21, 2017, at 11:29 AM, Robert Bennett via swift-evolution
> <[email protected]> wrote:
>
> If value-based generics become a thing, then you’ll be able to specify a URL
> type with URL<.file> which would pretty much solve this problem.
And then you could make APIs that are specific to certain schemes, and maybe
even have file references working again.
extension URL where Scheme == .file {
var path: String { … } // non-optional
}
extension URL where Scheme == .fileReference {
var path: String? { … } // optional
}
Charles
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution