Skip to content

Commit a7aeb0c

Browse files
committed
Don't use Pattern.Instructions outside of its file.
It sometimes causes compiler crashes, it doesn't in this case but we might as well be consistent and never use it.
1 parent 2d4636f commit a7aeb0c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Sources/Patterns/Operations on Patterns/AnyPattern.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
/// Can be used to store patterns in arrays and non-generic variables.
1010
public struct AnyPattern<Input: BidirectionalCollection>: Pattern where Input.Element: Hashable {
1111
@usableFromInline
12-
let _instructions: (inout Instructions) throws -> Void
12+
let _instructions: (inout ContiguousArray<Instruction<Input>>) throws -> Void
1313

1414
@inlinable
1515
public func createInstructions(_ instructions: inout ContiguousArray<Instruction<Input>>) throws {

Sources/Patterns/Operations on Patterns/Repetition.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public struct RepeatPattern<Wrapped: Pattern>: Pattern {
3232
let repeatedInstructions = try wrapped.createInstructions()
3333
for _ in 0 ..< min { instructions.append(contentsOf: repeatedInstructions) }
3434
if let max = max {
35-
let optionalRepeatedInstructions = Instructions {
35+
let optionalRepeatedInstructions = ContiguousArray<Instruction<Input>> {
3636
$0.append(.choice(offset: repeatedInstructions.count + 2))
3737
$0.append(contentsOf: repeatedInstructions)
3838
$0.append(.commit)

0 commit comments

Comments
 (0)