Skip to content

Commit 52635d1

Browse files
committed
Add type annotations so Swift 5.5 can build the parser recovery tests
1 parent 3413b19 commit 52635d1

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

Tests/SwiftParserTest/RecoveryTests.swift

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,11 @@ public class RecoveryTests: XCTestCase {
267267
var source = """
268268
(first second third struct: Int)
269269
"""
270-
let (_, currentToken) = source.withUTF8 { buffer in
271-
var parser = Parser(buffer)
272-
return (parser.parseFunctionSignature(), parser.currentToken)
273-
}
270+
let (_, currentToken): (RawFunctionSignatureSyntax, Lexer.Lexeme) =
271+
source.withUTF8 { buffer in
272+
var parser = Parser(buffer)
273+
return (parser.parseFunctionSignature(), parser.currentToken)
274+
}
274275

275276
// The 'struct' keyword should be taken as an indicator that a new decl
276277
// starts here, so `parseFunctionSignature` shouldn't eat it.
@@ -334,10 +335,11 @@ public class RecoveryTests: XCTestCase {
334335
(first second third
335336
: Int)
336337
"""
337-
let (_, currentToken) = source.withUTF8 { buffer in
338-
var parser = Parser(buffer)
339-
return (parser.parseFunctionSignature(), parser.currentToken)
340-
}
338+
let (_, currentToken): (RawFunctionSignatureSyntax, Lexer.Lexeme) =
339+
source.withUTF8 { buffer in
340+
var parser = Parser(buffer)
341+
return (parser.parseFunctionSignature(), parser.currentToken)
342+
}
341343

342344
XCTAssertEqual(currentToken.tokenKind, .colon)
343345
}

0 commit comments

Comments
 (0)