@@ -930,26 +930,23 @@ final class DeclarationTests: ParserTestCase {
930
930
931
931
func testTypedThrows( ) {
932
932
assertParse (
933
- " func test() throws(any Error) -> Int { } " ,
934
- experimentalFeatures: [ . typedThrows]
933
+ " func test() throws(any Error) -> Int { } "
935
934
)
936
935
937
936
assertParse (
938
937
"""
939
938
struct X {
940
939
init() throws(any Error) { }
941
940
}
942
- """ ,
943
- experimentalFeatures: [ . typedThrows]
941
+ """
944
942
)
945
943
946
944
assertParse (
947
945
" func test() throws(MyError) 1️⃣async {} " ,
948
946
diagnostics: [
949
947
DiagnosticSpec ( message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] )
950
948
] ,
951
- fixedSource: " func test() async throws(MyError) {} " ,
952
- experimentalFeatures: [ . typedThrows]
949
+ fixedSource: " func test() async throws(MyError) {} "
953
950
)
954
951
955
952
assertParse (
@@ -958,8 +955,7 @@ final class DeclarationTests: ParserTestCase {
958
955
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] ) ,
959
956
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
960
957
] ,
961
- fixedSource: " func test() async throws (MyError) {} " ,
962
- experimentalFeatures: [ . typedThrows]
958
+ fixedSource: " func test() async throws (MyError) {} "
963
959
)
964
960
965
961
assertParse (
@@ -968,8 +964,7 @@ final class DeclarationTests: ParserTestCase {
968
964
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
969
965
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError) async' in function " ) ,
970
966
] ,
971
- fixedSource: " func test() throws (MyError) async {} " ,
972
- experimentalFeatures: [ . typedThrows]
967
+ fixedSource: " func test() throws (MyError) async {} "
973
968
)
974
969
975
970
assertParse (
@@ -979,17 +974,15 @@ final class DeclarationTests: ParserTestCase {
979
974
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] ) ,
980
975
DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
981
976
] ,
982
- fixedSource: " func test() async throws (MyError) {} " ,
983
- experimentalFeatures: [ . typedThrows]
977
+ fixedSource: " func test() async throws (MyError) {} "
984
978
)
985
979
986
980
assertParse (
987
981
" func test() throws(MyError) 1️⃣await {} " ,
988
982
diagnostics: [
989
983
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'await' must precede 'throws' " , fixIts: [ " move 'await' in front of 'throws' " ] )
990
984
] ,
991
- fixedSource: " func test() async throws(MyError) {} " ,
992
- experimentalFeatures: [ . typedThrows]
985
+ fixedSource: " func test() async throws(MyError) {} "
993
986
)
994
987
995
988
assertParse (
@@ -998,8 +991,7 @@ final class DeclarationTests: ParserTestCase {
998
991
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'await' must precede 'throws' " , fixIts: [ " move 'await' in front of 'throws' " ] ) ,
999
992
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
1000
993
] ,
1001
- fixedSource: " func test() async throws (MyError) {} " ,
1002
- experimentalFeatures: [ . typedThrows]
994
+ fixedSource: " func test() async throws (MyError) {} "
1003
995
)
1004
996
1005
997
assertParse (
@@ -1008,8 +1000,7 @@ final class DeclarationTests: ParserTestCase {
1008
1000
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
1009
1001
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError) await' in function " ) ,
1010
1002
] ,
1011
- fixedSource: " func test() throws (MyError) await {} " ,
1012
- experimentalFeatures: [ . typedThrows]
1003
+ fixedSource: " func test() throws (MyError) await {} "
1013
1004
)
1014
1005
1015
1006
assertParse (
@@ -1018,16 +1009,14 @@ final class DeclarationTests: ParserTestCase {
1018
1009
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
1019
1010
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
1020
1011
] ,
1021
- fixedSource: " func test() awaitthrows (MyError) {} " , // FIXME: spacing
1022
- experimentalFeatures: [ . typedThrows]
1012
+ fixedSource: " func test() awaitthrows (MyError) {} " // FIXME: spacing
1023
1013
)
1024
1014
1025
1015
assertParse (
1026
1016
" func test() async1️⃣(MyError) {} " ,
1027
1017
diagnostics: [
1028
1018
DiagnosticSpec ( message: " unexpected code '(MyError)' in function " )
1029
- ] ,
1030
- experimentalFeatures: [ . typedThrows]
1019
+ ]
1031
1020
)
1032
1021
1033
1022
assertParse (
@@ -1036,8 +1025,7 @@ final class DeclarationTests: ParserTestCase {
1036
1025
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected async specifier; did you mean 'async'? " , fixIts: [ " replace 'await' with 'async' " ] ) ,
1037
1026
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
1038
1027
] ,
1039
- fixedSource: " func test() async (MyError) {} " ,
1040
- experimentalFeatures: [ . typedThrows]
1028
+ fixedSource: " func test() async (MyError) {} "
1041
1029
)
1042
1030
1043
1031
assertParse (
@@ -1046,22 +1034,19 @@ final class DeclarationTests: ParserTestCase {
1046
1034
DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
1047
1035
DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
1048
1036
] ,
1049
- fixedSource: " func test() throws (MyError) {} " ,
1050
- experimentalFeatures: [ . typedThrows]
1037
+ fixedSource: " func test() throws (MyError) {} "
1051
1038
)
1052
1039
1053
1040
assertParse (
1054
- " func test() throws(MyError) {} " ,
1055
- experimentalFeatures: [ . typedThrows]
1041
+ " func test() throws(MyError) {} "
1056
1042
)
1057
1043
1058
1044
assertParse (
1059
1045
" func test() throws(MyError)1️⃣async {} " , // no space between closing parenthesis and `async`
1060
1046
diagnostics: [
1061
1047
DiagnosticSpec ( message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] )
1062
1048
] ,
1063
- fixedSource: " func test() async throws(MyError){} " ,
1064
- experimentalFeatures: [ . typedThrows]
1049
+ fixedSource: " func test() async throws(MyError){} "
1065
1050
)
1066
1051
}
1067
1052
0 commit comments