Wado

Research: Swift's Ownership Decisions, and What Its Users Say About Them

Wado's affine types follow Swift's noncopyable types. This survey collects what Swift decided where copyable and noncopyable values meet, and what Swift's own users and designers say went wrong. It feeds WEP: Affine Types. Everything here was read from the sources listed at the end, as they stood on 2026-11-25.

Swift's decisions

A convention is not a kind

SE-0377 adds borrowing and consuming to parameters and to self. They say how a function receives a value. Whether the value can be copied is a property of its type. The two are independent.

Counting was not enough

Swift had counted classes before it had noncopyable types. SE-0390 gives the reason for adding them: a class can represent a unique resource, but "classes always demand shared ownership of the resource", with a heap allocation and a count, and "shared access often complicates or introduces unsafety or additional overhead into an object's APIs".

Generic code assumes copying

SE-0427 makes Copyable a requirement every type parameter, protocol and associated type carries unless it writes ~Copyable. Existing generic code is untouched. SE-0503 (Swift 6.4) extends the suppression to associated types.

The standard protocols were not widened

SE-0437 generalizes Optional, Result and the unsafe pointers, and says of the rest: "All other public protocols in the Standard Library continue to require their conforming types as well as all their associated types to be copyable for now", naming Equatable and Sequence among them.

Higher-order functions were left out for a reason of their own. Of Optional.map it asks "Is this function supposed to consume or borrow the optional?" and answers "the answer seems to be both!". One name cannot serve both, because the conventions take no part in overload resolution. The proposal defers the choice between a prefix (consumingMap) and a view (consuming.map).

Iteration got a second protocol

Sequence stays copyable-only. SE-0516 (Swift 6.4) adds Iterable beside it.

The existing protocol already carried the hazard. Sequence's documentation says: "Copying an iterator is safe, but advancing one copy of an iterator by calling its next() method may invalidate other copies of that iterator." Its adapters consume the sequence: makeIterator, filter, prefix and dropFirst are declared __consuming. IteratorProtocol has one requirement, mutating func next(), and no adapters.

A reference is a value that cannot escape

SE-0519 (Swift 6.4) adds first-class references as two types. Ref<Value> is Copyable & ~Escapable. MutableRef<Value> is ~Copyable & ~Escapable. Neither outlives its target, which SE-0446's lifetime dependencies check, and the target cannot be used while a MutableRef to it is alive.

The voices

The pieces add up to a lifetime system

Dave Abrahams, one of Swift's original designers and now on Hylo, opened a thread in February 2026 arguing that the features were each added at a small cost and together are a "march toward a full Rust-like lifetime system". His claim is that yielding accessors with borrow and inout bindings cover nearly every use, and that the rest is better left to unsafe code. He calls first-class reference types "extremely worrying".

The usual defence is progressive disclosure: most developers never meet these features. His reply: "It is a fallacy that complexity in the fundamental language base is ever really hidden." It appears hidden only "because the standard library hasn't (fully?) adopted it, at which point it is going to be in everyone's faces." Another poster, from 25 years on a large application team, adds that in a long-lived codebase somebody always decides an obscure feature is essential, and then everyone who debugs that module has to learn it.

Two hierarchies are forever

Reviewers of SE-0516 objected that it "introduces a parallel iteration hierarchy" which "users and library authors will have to learn and live with indefinitely", chosen to keep the compiler simpler.

The proposal's own author agrees about the default. Ben Cohen: borrowing "feels like the right default behavior", as it is for parameters, and "The opt in is for the rarer case of consuming." Swift cannot switch because the change breaks source and makeIterator cannot become consuming under a stable ABI. He adds that "eager implementations of e.g. map and filter were regrettable".

Sequence was already a regret

Jordan Rose, formerly of the Swift team, lists Sequence among his Swift regrets. Without move-only types, the language had to let makeIterator() be called repeatedly, and nothing says whether a second call continues, restarts or fails. An iterator is also not a sequence, so the adapters do not apply to it. Of the SE-0516 pitch he writes: "It may ultimately make sense to continue perpetuating the mistake of Sequence just for consistency".

Copies nobody wrote

A Swift compiler engineer is prototyping an "explicit copies mode": a function-level switch under which every copy the compiler would insert must be written copy x. The first example is for x in xs, which copies xs because makeIterator consumes it. Users report the same confusion from the other side: a consuming parameter that rejects let y = x and accepts passing x to a function and then returning it.

One spelling, three readings

~Copyable on a type means the type cannot be copied. On a type parameter it means the parameter might not be copyable. On a generic type with a conditional conformance it means both at once. A forum thread titled "Is ~Copyable confusing?" gets the answer "yes, it is confusing" from a poster who goes on to defend the design. Another writes that the spelling "has different meanings in your short code sample (even in a single line!)".

Nobody agrees when a value is destroyed

A thread from October 2026 asks whether a noncopyable type should release a system resource in its deinit at all. It was still open when this was written.

What separates Wado's position from Swift's

Sources

Proposals, in swiftlang/swift-evolution:

Discussion: