[swift-evolution] [Pre-pitch] Conditional default arguments

Slava Pestov spestov at apple.com
Tue Nov 28 15:18:47 CST 2017

> On Nov 28, 2017, at 8:44 AM, Matthew Johnson <matthew at anandabits.com> wrote:
> func makeResource(
>     with configuration: Configuration = () where Configuration == Void, 
>     actionHandler: @escaping (Action) -> Void = { _ in } where Action == Never
> )

Similar question to the one I posed earlier — what happens if I’m using makeResource() from a generic context? Is the conditional default argument simply not available?

In this case, how is it different from defining some static overloads of makeResource(), some of which have default arguments and some of which are generic?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20171128/627be368/attachment.html>

More information about the swift-evolution mailing list