Avatar
Joe_Groff One potential midpoint we could take is to make some the default in places where some or any doesn't really affect the domain of a function, particularly for non-inout function arguments. With the recent additions to generalize existentials and allow for implicit opening, func foo(_: some P) and func foo(_: any P) both accept the same sets of parameters and have the same sets of capabilities operating on their arguments, but func foo(_: some P) is slightly more efficient as public ABI because it can accept a conforming value as-is without boxing it, and also more flexible by default inside the body of foo, since you can use all of P's methods on it without an opening step. It would make sense to favor the more efficient, more expressive interpretation of func foo(_: P) to mean func foo(_: some P), independent of what we choose to do in places where there's an effective semantic difference.
https://forums.swift.org/t/discussion-eliding-some-in-swift-6/57918/5
1:59 AM
仮に func foo(_: P)func foo(_: some P) にするとして、 func foo(_: [P])func foo(_: [some P]) になるのかな?それはまた違う気が・・・。