Normally in the discussion of things like some, they are referring to return types. This question is specifically about using any or some in argument lists.
As an example, in the Swift documentation for String, you have this initializer...
init<T>(_ value: T, radix: Int = 10, uppercase: Bool = false)
where T : BinaryInteger
In Swift 5.6, they introduced the any keyword to let us work with existential types more easily. With that change, I understand you theoretically can rewrite the above like so...
init(_ value: any BinaryInteger, radix: Int = 10, uppercase: Bool = false)
Of course there's also this version based on the some keyword, which also works...
init(_ value: some BinaryInteger, radix: Int = 10, uppercase: Bool = false)
My question is... which one makes the most sense? Is there a down-side to using the existential type over the generic like that? What about the some version? I was originally thinking yes, the generic version is best because the compiler can determine at compile time what's being passed to it, but then again, so does the existential any and even the some version as it won't compile if you don't pass it a BinaryInteger and I'm not quite sure how to write a test to check this out.