[stdlib] Default implementation for BinaryInteger._word(at:)#10460
[stdlib] Default implementation for BinaryInteger._word(at:)#10460moiseev merged 1 commit intoswiftlang:masterfrom moiseev:word-at
Conversation
|
@swift-ci Please test |
|
/cc @lorentey |
|
Looks like a fine short-term fix! Do you want me to try my hand at making a PR for the full thing? |
|
@lorentey that would be amazing! |
|
👍 I'll see what I can do, hopefully tomorrow. |
|
Wait, getting a failure at run time about an API you aren't supposed to implement is worse than getting it at compile time. |
|
Making a default implementation cycle would be a better short-term fix. |
|
Right! I'll submit a PR with |
|
@jrose-apple All the built-in types override this method, all the conformances should implement |
|
|
|
Yes, but the problem is that until it becomes possible to explicitly constrain My workaround is to have |
|
|
|
That would work very well! Is it OK to add a constraint like that on the public protocol requirement? (If so, I'd choose |
|
With a |
|
Ah, if nothing is calling |
|
Sadly the |
|
@moiseev, @jrose-apple: I submitted #10558 with a working (if suboptimal) attempt at making Adding extra constraints on the conversion initializer requirements quickly turned out to be infeasible in practice -- it lead to frequent difficulties with numeric conversions in generic contexts. (For example, consider That leaves #10558 chooses an alternative API and contains a discussion of some other approaches that may lead to better results. |
Temporarily addresses https://bugs.swift.org/browse/SR-5275