Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ParseableInterface test failure workaround (#73)
Disables `RangeReplaceableCollection` conformance for now until we find a way to declare a conformance without triggering #73.
  • Loading branch information
rxwei committed Dec 14, 2021
commit e04c9bccc7978d330c82f41b36671a986bf2532c
12 changes: 12 additions & 0 deletions Sources/_MatchingEngine/Utility/TypedIndex.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ extension TypedIndex: BidirectionalCollection where C: BidirectionalCollection {
Index(rawValue.index(before: before.rawValue))
}
}

// FIXME(apple/swift-experimental-string-processing#73): ParseableInterface test
// failure in the Swift repo.
#if false
extension TypedIndex: RangeReplaceableCollection where C: RangeReplaceableCollection {
@_alwaysEmitIntoClient
public init() { rawValue = C() }
Expand All @@ -88,6 +92,14 @@ extension TypedIndex: RangeReplaceableCollection where C: RangeReplaceableCollec

// TODO: append, and all the other customization hooks...
}
#endif

// Workaround for #73
extension TypedIndex where C: RangeReplaceableCollection {
public mutating func append(_ newElement: Element) {
rawValue.append(newElement)
}
}

extension TypedIndex: ExpressibleByArrayLiteral where C: ExpressibleByArrayLiteral & RangeReplaceableCollection {
@_alwaysEmitIntoClient
Expand Down