Skip to content

Commit abffe3c

Browse files
committed
Replace [TriviaPiece].Index with Array<TriviaPiece>.Index.
The former works with Swift 5.9, but fails in earlier versions. Fixes #564.
1 parent df5ad65 commit abffe3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/SwiftFormatCore/DocumentationCommentText.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public func documentationCommentText(extractedFrom trivia: Trivia)
4343
// Look backwards from the end of the trivia collection to find the logical start of the comment.
4444
// We have to copy it into an array since `Trivia` doesn't support bidirectional indexing.
4545
let triviaArray = Array(trivia)
46-
let commentStartIndex: [TriviaPiece].Index
46+
let commentStartIndex: Array<TriviaPiece>.Index
4747
if
4848
let lastNonDocCommentIndex = triviaArray.lastIndex(where: {
4949
switch $0 {
@@ -140,7 +140,7 @@ private func indentationDistance(of text: Substring) -> Int {
140140
/// given trivia piece.
141141
private func contiguousWhitespace(
142142
in trivia: [TriviaPiece],
143-
before index: [TriviaPiece].Index
143+
before index: Array<TriviaPiece>.Index
144144
) -> Int {
145145
var index = index
146146
var whitespace = 0

0 commit comments

Comments
 (0)