-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[stdlib] fix another accidental infinite-recursion bug #38950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@swift-ci please test macOS platform |
Build failed |
fixes: SR-6501, SR-11516
@swift-ci please test macOS platform |
@swift-ci please smoke test |
@swift-ci Please Test Source Compatibility |
2 similar comments
@swift-ci Please Test Source Compatibility |
@swift-ci Please Test Source Compatibility |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
fwiw this broke source compatibility. For a good reason, ofc! |
Yeah, breaking code that relies on a bug is deemed not to be an actual source break. |
Expanding a little on what Guillaume said, code that was "broken" by this change merely compiled; it never actually worked because it had an invalid conformance to RangeReplaceableCollection. Thus, there is no source break--conformances must satisfy the semantic contract of the protocol in a Swift program*. (*) Yes, the program used to compile, but it was not a valid Swift program; we simply were unable to detect the constraint violation at compile time. Now we can. |
…lang#38950)" This reverts commit 6b219a9.
[5.6] Revert "[stdlib] fix another accidental infinite-recursion bug (#38950)"
It's been known for years (see SR-6501) that it's easy to forget to implement the critical function
replaceSubrange<C>(_: with: C)
when conforming a type toRangeReplaceableCollection
, because the compiler doesn't ask for it. At runtime, there is then an infinite-recursion crash on just about any RRC-specific function.This adds an unavailable implementation to transform this issue into a compile-time error, in line with other recent similar fixes, such as #36969.
Resolves SR-6501