This document lists the outstanding issues whose resolution could cause non-additive standard library API changes.
-
The global function
withUnsafe[Mutable]Pointer(&x)
should have an argument label “to
”.https://bugs.swift.org/browse/SR-1937 rdar://problem/26529498.
-
UnicodeScalar.init(Int)
should be failable.https://bugs.swift.org/browse/SR-1930 rdar://problem/24110013
-
withUnsafePointer
shouldn't take its argument asinout
.https://bugs.swift.org/browse/SR-1956 rdar://problem/25019862
-
Remove
unsafeAddressOf
. We are not aware of any real usecases for it. If there are any, it should be renamed tounsafeAddress(of:)
to follow the guidelines.https://bugs.swift.org/browse/SR-1957 rdar://problem/18589289
-
[SE-0124]
Int.init(ObjectIdentifier)
andUInt.init(ObjectIdentifier)
should have abitPattern:
label (i.e.,Int.init(bitPattern:)
andUInt.init(bitPattern:)
). -
Consider renaming or eliminating
ManagedProtoBuffer
.The reason why
ManagedProtoBuffer
exists is to give the users an extra bit of type safety inside of the closure passed toManagedBuffer.create()
. This closure receives theManagedBuffer
instance and returns the initial value that is stored in the buffer (the header part of the buffer). We are passing theManagedBuffer
asManagedProtoBuffer
to prevent the closure from reading the uninitializedvalue
property. Maybe this extra bit of safety is not worth the API surface complexity.https://bugs.swift.org/browse/SR-1955 rdar://problem/26012924 rdar://problem/27118532
-
String.CharacterView.Iterator
should be a custom type rather than the default, to allow performance optimizations. Audit all other collections for such opportunities.https://bugs.swift.org/browse/SR-1961 rdar://problem/27119937
-
String(count:, repeatedValue:)
andString.append()
are ambiguous without an explicit cast toCharacter
.Fix by removing overloads on
Character
andUnicodeScalar
, leaving onlyString
.https://bugs.swift.org/browse/SR-1964 rdar://problem/17028332
-
[DONE] Rename the
~LiteralConvertible
protocols according to the resolution of the proposal currently under review.
-
Make
CountableRange.Index
be itsBounds.Stride
.https://bugs.swift.org/browse/SR-1959 rdar://problem/26302563
-
[SE-0120] Fix the API of
partition
.https://bugs.swift.org/browse/SR-1965 rdar://problem/26708352
-
Move
AutoreleasingUnsafeMutablePointer
to theObjectiveC
overlay. -
[In progress] Consider simplifying the
isUniquelyReferenced()
family and eliminatingNonObjectiveCBase
.https://bugs.swift.org/browse/SR-1962 rdar://problem/21886410 rdar://problem/21969812
-
Audit occurrences of
UnsafeMutablePointer
in the standard library to see if they can be changed toUnsafePointer
.https://bugs.swift.org/browse/SR-1958 rdar://problem/18090166
Collections:
-
Figure out the role and design of
Sequence
andIterator
. Algorithms not markedmutating
can consume a single-passSequence
. RemoveSequence
. MakeIterator
be the type for single-pass sequences.In future
Sequence.makeIterator()
would be mutating, and we'd require:for x in &mySequence { print(x) }
compare this to:
for inout x in &myArray { x += 1 }
Important.
-
Change
Collection
to be potentially-infinite, and introduceFiniteCollection
. Do we need a separate protocol? Can we just add a QoI feature to trap early instead of executing an infinite loop? (We can add a propertyisKnownToBeInfinite
/isKnownToBeFinite
that would be checked before the whole collection is iterated.)Important.
-
Figure out whether
RangeReplaceableCollection.replaceRange
should accept a Sequence as its argument, and if so implement it.NTBF if we are removing Sequence.
-
Decide whether to drop the
Comparable
requirement on indices, and if so, do it. Consider the impact on range types. Important.
Naming:
-
Reconsider naming of term-of-art functional algorithms (
map
,filter
,flatten
,flatMap
etc.) Important. -
Rationalize the naming of the slicing operations (e.g.
prefix
,suffix
, ...) Important.
Misc:
-
Fallout from the
UnsafeRawPointer
review currently underway. Important. -
Design and implement the spaceship operator
<=>
as a replacement or a supplement forComparable
. Important.
Misc and less important for Swift 3.x:
-
Redesign/reimplement
Strideable
, fixing issues like the result type of thedistance
method and applicability to complex numbers, in which case it could no longer implyComparable
. -
Fix the design of
Unmanaged
.
-
Associative collections with custom hash/equality.
-
More static type safety for
PlaygroundQuicklook
payloads.rdar://problem/22871025
-
Decouple
CustomPlaygroundQuicklookable
from the standard library. -
Swiftify the
simd
module. Current implementation ofsimd
module in Swift mirrors the C API. Swift can provide a better API. (Steve Canon) -
Range
<=>NSRange
bridging, including ranges ofString.Index
This will create work on the compiler side once we figure out the design.
-
Remove the
Boolean
protocol. -
CVarArgs
doesn't support optional pointers. -
Reflection: what is the design for writing and calling methods through mirrors? Would it affect the current
Mirror
design in a non-additive way? -
Due to compiler bugs, some lazy collections have the wrong associated
SubSequence
types -
Fallout on APIs from generics changes such as
- adding “where” constraints on associated types
- adding recursive constraints
- adding the ability to nest types in generics
- typealiases in protocols
In particular
- killing off
Indexable
and the underscored protocols - killing off
CountableRange
andCountableClosedRange
- Many lazy collection types collapse
- Collapse 3 Default Indices types
- Collapse 12 Default Slice types
- Sink custom iterator and index types into the corresponding
primary types (e.g.,
DictionaryIterator
=>Dictionary.Iterator
) - Move lazy collection wrappers into an enum "namespace" so that they don't pollute the global namespace. https://bugs.swift.org/browse/SR-1966