> On Jan 23, 2017, at 3:18 PM, Srđan Rašić via swift-evolution
> <[email protected]> wrote:
>
>
> I think such cases would be extremely rare and one would have to be very
> ignorant about the types he/she works with. Additionally, that syntax is
> useful only for types with one generic argument. Say we have `Promise<T, E =
> Error>` and declare property as `let p: Promise<Int>`. How would you convey
> the information that there is a second argument that could be changed?
> Keeping the comma would be very ugly :)
To elaborate on this, default arguments are also a powerful tool for
introducing new generic parameters in a way that’s source compatible.
(potentially ABI compatible? Haven’t thought out implications of that). For
instance, if you have a collection type, and decide to expose the allocator as
a type parameter, defaults give you a backwards compatible way to do that.
Making developers annotate “I’m using defaults” throws that away. If you make
this “only” a warning then you’re just making busywork for the 99% of
developers who always wanted the default behaviour, and couldn’t care less that
it’s now configurable.
This would also go against the massive precedent set by default function
arguments, which never need to be acknowledged.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution