Skip to content

[ContainersPreview] Remove BorrowingSequence.first#598

Merged
lorentey merged 1 commit intoapple:mainfrom
lorentey:remove-BorrowingSequence.first
Mar 9, 2026
Merged

[ContainersPreview] Remove BorrowingSequence.first#598
lorentey merged 1 commit intoapple:mainfrom
lorentey:remove-BorrowingSequence.first

Conversation

@lorentey
Copy link
Member

@lorentey lorentey commented Mar 9, 2026

This property is unnecessary; it was just demonstrating an old problem. It clashes with the classic Collection.first, and that renders invocations of that ambiguous in code that uses Collection types that also have a BorrowingSequence conformance.

If we end up adding first/last properties on Container, their type should probably be Borrow<Element>, unless they'd be restricted to copyable types.

This property is unnecessary; it was just demonstrating an old problem. It clashes with the classic `Collection.first`, and that renders invocations of that ambiguous in code that uses Collection types that also have a BorrowingSequence conformance.
@lorentey lorentey added this to the 1.4.1 milestone Mar 9, 2026
Copy link

@tfpauly tfpauly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! This resolves conflicts on adoption.

@lorentey lorentey merged commit 41beccb into apple:main Mar 9, 2026
76 of 78 checks passed
@lorentey lorentey deleted the remove-BorrowingSequence.first branch March 9, 2026 23:40
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