Skip to content

Fix warnings: private setters cannot be referenced from an '@inlinable' function - #3719

Merged
fabianfett merged 9 commits into
apple:mainfrom
fabianfett:ff-fix-warnings
Sep 2, 2026
Merged

fabianfett merged 9 commits into
apple:mainfrom
fabianfett:ff-fix-warnings

Conversation

@fabianfett

Copy link
Copy Markdown
Member

Fix the following warnings:

setter for property 'xxx' is private and cannot be referenced from an '@inlinable' function; this will be an error in a future Swift language mode

Fix the following warnings:

> setter for property 'xxx' is private and cannot be referenced from an '@inlinable' function; this will be an error in a future Swift language mode
@fabianfett fabianfett changed the title Fix warnings Fix warnings: private setters cannot be referenced from an '@inlinable' function Aug 25, 2026
@fabianfett fabianfett added the 🔨 semver/patch No public API change. label Aug 25, 2026
Comment thread Sources/_NIODataStructures/Heap.swift Outdated
internal struct Heap<Element: Comparable> {
@usableFromInline
internal private(set) var storage: [Element]
internal var storage: [Element]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This applies more generally, but where we remove private(set) I think we should audit for callers and see whether it should become underscored (to indicate it's private) and have a non-underscored computed property for reading if necessary.

setBytesWithoutContigiousStorageMoreThanUInt32MaxBytes built a
CircularBuffer<UInt8> of UInt32.max + 1 elements just to get a
collection without contiguous storage. That is ~4.3 billion appends
through the generic RangeReplaceableCollection path, each capacity
doubling running an O(n) verifyInvariants() assert, which took 20-70
minutes in a debug build. Since the PR workflow sets
SWIFTNIO_RUN_SLOW_TESTS=1, every PR paid that cost on all Linux and
macOS jobs running Swift 6.2+ (exit tests need compiler 6.2), pushing
the one-hour macOS limit and timing out.

Repeated is also a collection without contiguous storage, and it takes
the same _setSlowPath, which traps converting underestimatedCount to a
UInt32 index, so nothing needs to be materialised at all. The test now
runs in 0.05s instead of tens of minutes, and no longer needs the
opt-in gate.
@fabianfett
fabianfett enabled auto-merge (squash) September 2, 2026 22:41
@fabianfett
fabianfett merged commit e8e0774 into apple:main Sep 2, 2026
54 of 58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants