Skip to content

Conversation

@natecook1000
Copy link
Member

@natecook1000 natecook1000 commented Dec 15, 2025

Adds a new BorrowingSequence and makes Sequence extend the new protocol.

Issues still to tackle:

  • unsure how to handle availability for Sequence protocol when its declaration would require the availability-constrained BorrowingSequence – availability checking currently off
  • conditionally-conforming Sequence types (like Range<Int>) don't implicitly conform to BorrowingSequence
  • commented out both a chunk of SwiftOnone.swift specialization code and the bit of the compiler that verifies the existence of those prespecialized symbols

So far this runs into the issue that conditionally-conforming Sequence
types (like Range<Int>) don't implicitly conform to BorrowingSequence.
@natecook1000 natecook1000 changed the title Initial work on BorrowingSequence above Sequence WIP: Add BorrowingSequence above Sequence Dec 15, 2025
@benrimmington
Copy link
Contributor

Library Evolution in Swift:

Changes to a protocol’s list of refined protocols are not allowed.

Returning self from this default impl of makeBorrowingInterator() is
consuming, so it requires a copyable type (like Span).
This disables the SwiftOnone code that triggers errors like:

Cannot pre-specialize $sSMsSKRzrlE14_insertionSort6within2byySny5IndexSlQzG_Sb7ElementSTQz_AHtKXEtKF

and also disables the diagnostics when those prespecialized symbols
can no longer be found.
@natecook1000
Copy link
Member Author

@swift-ci Please smoke test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants