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

Slava Pestov spestov at apple.com
Tue Nov 28 16:11:50 CST 2017



> On Nov 28, 2017, at 1:35 PM, Matthew Johnson <matthew at anandabits.com> wrote:
> 
>>> * the compiler doesn’t have to reason about an overload set which might improve build times, etc
>> 
>> They’re effectively equivalent, because we still have to decide which subset of the default arguments apply at a given call site by checking all combinations of constraints.
> 
> Interesting.  Are there no advantages to the compiler that would be possible if an overload set was replaced with constrained default arguments?
> 

Probably not. In general I’m wary of designing language features specifically to speed up the type checker, since they make not have the intended effect or even the opposite effect. We know the type checker implementation is not the best possible implementation of a type checker — there is a lot we can improve without changing the language.

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


More information about the swift-evolution mailing list