Skip to content

Commit f2f8656

Browse files
flashspysahoppen
andauthored
Update Sources/SwiftParser/Types.swift
Co-authored-by: Alex Hoppen <[email protected]>
1 parent b5753ad commit f2f8656

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Sources/SwiftParser/Types.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,7 @@ extension Parser {
452452
let type = self.parseType(misplacedSpecifiers: misplacedSpecifiers)
453453
let ellipsis = self.currentToken.isEllipsis ? self.consumeAnyToken() : nil
454454
var trailingComma = self.consume(if: .comma)
455-
var lookahead = self.lookahead()
456-
if trailingComma == nil && lookahead.canParseType() {
455+
if trailingComma == nil && self.withLookahead({ $0.canParseType() }) {
457456
// If the next token does not close the tuple, it is very likely the user forgot the comma.
458457
trailingComma = self.missingToken(.comma)
459458
}

0 commit comments

Comments
 (0)