Skip to content

Commit fd0b691

Browse files
committed
Enable the sendingArgsAndResults experimental feature
SE-0430 was accepted for Swift 6.0 but the experimental feature was not enabled with the proposal’s acceptance.
1 parent e674d66 commit fd0b691

File tree

8 files changed

+9
-38
lines changed

8 files changed

+9
-38
lines changed

CodeGeneration/Sources/SyntaxSupport/ExperimentalFeatures.swift

-3
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ public enum ExperimentalFeature: String, CaseIterable {
1818
case doExpressions
1919
case nonescapableTypes
2020
case trailingComma
21-
case sendingArgsAndResults
2221

2322
/// The name of the feature, which is used in the doc comment.
2423
public var featureName: String {
@@ -33,8 +32,6 @@ public enum ExperimentalFeature: String, CaseIterable {
3332
return "NonEscableTypes"
3433
case .trailingComma:
3534
return "trailing comma"
36-
case .sendingArgsAndResults:
37-
return "SendingArgsAndResults"
3835
}
3936
}
4037

CodeGeneration/Sources/SyntaxSupport/KeywordSpec.swift

+1-4
Original file line numberDiff line numberDiff line change
@@ -687,10 +687,7 @@ public enum Keyword: CaseIterable {
687687
case .throws:
688688
return KeywordSpec("throws", isLexerClassified: true)
689689
case .sending:
690-
return KeywordSpec(
691-
"sending",
692-
experimentalFeature: .sendingArgsAndResults
693-
)
690+
return KeywordSpec("sending")
694691
case .transpose:
695692
return KeywordSpec("transpose")
696693
case .true:

Sources/SwiftParser/Patterns.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ extension Parser.Lookahead {
377377
&& !self.at(.keyword(._const))
378378
&& !self.at(.keyword(.borrowing))
379379
&& !self.at(.keyword(.consuming))
380-
&& !(experimentalFeatures.contains(.sendingArgsAndResults) && self.at(.keyword(.sending)))
380+
&& !self.at(.keyword(.sending))
381381
{
382382
return true
383383
}

Sources/SwiftParser/generated/ExperimentalFeatures.swift

-3
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,4 @@ extension Parser.ExperimentalFeatures {
3838

3939
/// Whether to enable the parsing of trailing comma.
4040
public static let trailingComma = Self (rawValue: 1 << 4)
41-
42-
/// Whether to enable the parsing of SendingArgsAndResults.
43-
public static let sendingArgsAndResults = Self (rawValue: 1 << 5)
4441
}

Sources/SwiftParser/generated/Parser+TokenSpecSet.swift

+2-8
Original file line numberDiff line numberDiff line change
@@ -858,9 +858,6 @@ extension DeclModifierSyntax {
858858
case `static`
859859
case unowned
860860
case weak
861-
#if compiler(>=5.8)
862-
@_spi(ExperimentalLanguageFeatures)
863-
#endif
864861
case sending
865862

866863
init?(lexeme: Lexer.Lexeme, experimentalFeatures: Parser.ExperimentalFeatures) {
@@ -935,7 +932,7 @@ extension DeclModifierSyntax {
935932
self = .unowned
936933
case TokenSpec(.weak):
937934
self = .weak
938-
case TokenSpec(.sending) where experimentalFeatures.contains(.sendingArgsAndResults):
935+
case TokenSpec(.sending):
939936
self = .sending
940937
default:
941938
return nil
@@ -3379,9 +3376,6 @@ extension SimpleTypeSpecifierSyntax {
33793376
case _const
33803377
case borrowing
33813378
case consuming
3382-
#if compiler(>=5.8)
3383-
@_spi(ExperimentalLanguageFeatures)
3384-
#endif
33853379
case sending
33863380

33873381
init?(lexeme: Lexer.Lexeme, experimentalFeatures: Parser.ExperimentalFeatures) {
@@ -3400,7 +3394,7 @@ extension SimpleTypeSpecifierSyntax {
34003394
self = .borrowing
34013395
case TokenSpec(.consuming):
34023396
self = .consuming
3403-
case TokenSpec(.sending) where experimentalFeatures.contains(.sendingArgsAndResults):
3397+
case TokenSpec(.sending):
34043398
self = .sending
34053399
default:
34063400
return nil

Sources/SwiftSyntax/generated/Keyword.swift

-3
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,6 @@ public enum Keyword: UInt8, Hashable, Sendable {
203203
#endif
204204
case scoped
205205
case `self`
206-
#if compiler(>=5.8)
207-
@_spi(ExperimentalLanguageFeatures)
208-
#endif
209206
case sending
210207
case `Self`
211208
case Sendable

Tests/SwiftParserTest/DeclarationTests.swift

+3-12
Original file line numberDiff line numberDiff line change
@@ -3270,18 +3270,9 @@ final class DeclarationTests: ParserTestCase {
32703270
}
32713271

32723272
func testSendingTypeSpecifier() {
3273-
assertParse(
3274-
"func testVarDeclTupleElt() -> (sending String, String) {}",
3275-
experimentalFeatures: .sendingArgsAndResults
3276-
)
3277-
assertParse(
3278-
"func testVarDeclTuple2(_ x: (sending String)) {}",
3279-
experimentalFeatures: .sendingArgsAndResults
3280-
)
3281-
assertParse(
3282-
"func testVarDeclTuple2(_ x: (sending String, String)) {}",
3283-
experimentalFeatures: .sendingArgsAndResults
3284-
)
3273+
assertParse("func testVarDeclTupleElt() -> (sending String, String) {}")
3274+
assertParse("func testVarDeclTuple2(_ x: (sending String)) {}")
3275+
assertParse("func testVarDeclTuple2(_ x: (sending String, String)) {}")
32853276
}
32863277

32873278
func testMisplacedAttributeInVarDeclWithMultipleBindings() {

Tests/SwiftParserTest/SendingTest.swift

+2-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ final class SendingTests: ParserTestCase {
1919
"""
2020
class Klass {}
2121
func transferMain(_ x: sending Klass) -> ()
22-
""",
23-
experimentalFeatures: .sendingArgsAndResults
22+
"""
2423
)
2524
}
2625

@@ -29,8 +28,7 @@ final class SendingTests: ParserTestCase {
2928
"""
3029
class Klass {}
3130
func transferMain(_ y: Klass, _ x: sending Klass, _ z: Klass) -> ()
32-
""",
33-
experimentalFeatures: .sendingArgsAndResults
31+
"""
3432
)
3533
}
3634
}

0 commit comments

Comments
 (0)