Skip to content

Commit

Permalink
ParseableInterface test failure workaround (apple#73)
Browse files Browse the repository at this point in the history
Disables `RangeReplaceableCollection` conformance for now until we find a way to declare a conformance without triggering apple#73.
  • Loading branch information
rxwei committed Dec 14, 2021
1 parent 0dc8ac3 commit e04c9bc
Showing 1 changed file with 12 additions and 0 deletions.
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

0 comments on commit e04c9bc

Please sign in to comment.