Open
Description
Description
Some types should have conditional conformances to BitwiseCopyable, but don't have any.
Reproduction
$ xcrun --toolchain org.swift.62202502171a swift repl
Welcome to Apple Swift version 6.2-dev (LLVM a1d5a03ff545308, Swift d0e4f84cb37b055).
Type :help for assistance.
1> func bc(_ v: some BitwiseCopyable) {}
2> bc(0..<1)
˄
│error: global function 'bc' requires that 'Range<Int>' conform to 'BitwiseCopyable'
╰─ note: where 'some BitwiseCopyable' = 'Range<Int>'
Expected behavior
The following types have good reason to conditionally conform to BitwiseCopyable
:
ClosedRange
ClosedRange.Index
CollectionOfOne
CollectionOfOne.Iterator
DefaultIndices
DropFirstSequence
DropWhileSequence
DropWhileSequence.Iterator
EnumeratedSequence
EnumeratedSequence.Iterator
FlattenSequence
FlattenSequence.Index
FlattenSequence.Iterator
IndexingIterator
IteratorSequence
LazySequence
PartialRangeFrom
PartialRangeFrom.Iterator
PartialRangeThrough
PartialRangeUpTo
PrefixSequence
PrefixSequence.Iterator
Range
Repeated
ReversedCollection
ReversedCollection.Index
ReversedCollection.Iterator
SIMDMask
Slice
StrideThrough
StrideThroughIterator
StrideTo
StrideToIterator
Unicode.ParseResult
Zip2Sequence
Zip2Sequence.Iterator
Furthermore, the following non-frozen types should conform but do not:
ContinuousClock
ContinuousClock.Instant
FloatingPointRoundingRule
MachErrorCode
POSIXErrorCode
SuspendingClock
SuspendingClock.Instant
Unicode.CanonicalCombiningClass
Unicode.GeneralCategory
Unicode.NumericType
Unicode.Scalar.Properties
Environment
$ xcrun --toolchain org.swift.62202502171a swift --version
Apple Swift version 6.2-dev (LLVM a1d5a03ff545308, Swift d0e4f84)
Target: arm64-apple-macosx15.0
Build config: +assertions
This is swift-DEVELOPMENT-SNAPSHOT-2025-02-17-a
Additional information
rdar://138600947
https://forums.swift.org/t/76379/