@@ -930,26 +930,23 @@ final class DeclarationTests: ParserTestCase {
930930
931931 func testTypedThrows( ) {
932932 assertParse (
933- " func test() throws(any Error) -> Int { } " ,
934- experimentalFeatures: [ . typedThrows]
933+ " func test() throws(any Error) -> Int { } "
935934 )
936935
937936 assertParse (
938937 """
939938 struct X {
940939 init() throws(any Error) { }
941940 }
942- """ ,
943- experimentalFeatures: [ . typedThrows]
941+ """
944942 )
945943
946944 assertParse (
947945 " func test() throws(MyError) 1️⃣async {} " ,
948946 diagnostics: [
949947 DiagnosticSpec ( message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] )
950948 ] ,
951- fixedSource: " func test() async throws(MyError) {} " ,
952- experimentalFeatures: [ . typedThrows]
949+ fixedSource: " func test() async throws(MyError) {} "
953950 )
954951
955952 assertParse (
@@ -958,8 +955,7 @@ final class DeclarationTests: ParserTestCase {
958955 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] ) ,
959956 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
960957 ] ,
961- fixedSource: " func test() async throws (MyError) {} " ,
962- experimentalFeatures: [ . typedThrows]
958+ fixedSource: " func test() async throws (MyError) {} "
963959 )
964960
965961 assertParse (
@@ -968,8 +964,7 @@ final class DeclarationTests: ParserTestCase {
968964 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
969965 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError) async' in function " ) ,
970966 ] ,
971- fixedSource: " func test() throws (MyError) async {} " ,
972- experimentalFeatures: [ . typedThrows]
967+ fixedSource: " func test() throws (MyError) async {} "
973968 )
974969
975970 assertParse (
@@ -979,17 +974,15 @@ final class DeclarationTests: ParserTestCase {
979974 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] ) ,
980975 DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
981976 ] ,
982- fixedSource: " func test() async throws (MyError) {} " ,
983- experimentalFeatures: [ . typedThrows]
977+ fixedSource: " func test() async throws (MyError) {} "
984978 )
985979
986980 assertParse (
987981 " func test() throws(MyError) 1️⃣await {} " ,
988982 diagnostics: [
989983 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'await' must precede 'throws' " , fixIts: [ " move 'await' in front of 'throws' " ] )
990984 ] ,
991- fixedSource: " func test() async throws(MyError) {} " ,
992- experimentalFeatures: [ . typedThrows]
985+ fixedSource: " func test() async throws(MyError) {} "
993986 )
994987
995988 assertParse (
@@ -998,8 +991,7 @@ final class DeclarationTests: ParserTestCase {
998991 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'await' must precede 'throws' " , fixIts: [ " move 'await' in front of 'throws' " ] ) ,
999992 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
1000993 ] ,
1001- fixedSource: " func test() async throws (MyError) {} " ,
1002- experimentalFeatures: [ . typedThrows]
994+ fixedSource: " func test() async throws (MyError) {} "
1003995 )
1004996
1005997 assertParse (
@@ -1008,8 +1000,7 @@ final class DeclarationTests: ParserTestCase {
10081000 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
10091001 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError) await' in function " ) ,
10101002 ] ,
1011- fixedSource: " func test() throws (MyError) await {} " ,
1012- experimentalFeatures: [ . typedThrows]
1003+ fixedSource: " func test() throws (MyError) await {} "
10131004 )
10141005
10151006 assertParse (
@@ -1018,16 +1009,14 @@ final class DeclarationTests: ParserTestCase {
10181009 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
10191010 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
10201011 ] ,
1021- fixedSource: " func test() awaitthrows (MyError) {} " , // FIXME: spacing
1022- experimentalFeatures: [ . typedThrows]
1012+ fixedSource: " func test() awaitthrows (MyError) {} " // FIXME: spacing
10231013 )
10241014
10251015 assertParse (
10261016 " func test() async1️⃣(MyError) {} " ,
10271017 diagnostics: [
10281018 DiagnosticSpec ( message: " unexpected code '(MyError)' in function " )
1029- ] ,
1030- experimentalFeatures: [ . typedThrows]
1019+ ]
10311020 )
10321021
10331022 assertParse (
@@ -1036,8 +1025,7 @@ final class DeclarationTests: ParserTestCase {
10361025 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected async specifier; did you mean 'async'? " , fixIts: [ " replace 'await' with 'async' " ] ) ,
10371026 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
10381027 ] ,
1039- fixedSource: " func test() async (MyError) {} " ,
1040- experimentalFeatures: [ . typedThrows]
1028+ fixedSource: " func test() async (MyError) {} "
10411029 )
10421030
10431031 assertParse (
@@ -1046,22 +1034,19 @@ final class DeclarationTests: ParserTestCase {
10461034 DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected throwing specifier; did you mean 'throws'? " , fixIts: [ " replace 'try' with 'throws' " ] ) ,
10471035 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " unexpected code '(MyError)' in function " ) ,
10481036 ] ,
1049- fixedSource: " func test() throws (MyError) {} " ,
1050- experimentalFeatures: [ . typedThrows]
1037+ fixedSource: " func test() throws (MyError) {} "
10511038 )
10521039
10531040 assertParse (
1054- " func test() throws(MyError) {} " ,
1055- experimentalFeatures: [ . typedThrows]
1041+ " func test() throws(MyError) {} "
10561042 )
10571043
10581044 assertParse (
10591045 " func test() throws(MyError)1️⃣async {} " , // no space between closing parenthesis and `async`
10601046 diagnostics: [
10611047 DiagnosticSpec ( message: " 'async' must precede 'throws' " , fixIts: [ " move 'async' in front of 'throws' " ] )
10621048 ] ,
1063- fixedSource: " func test() async throws(MyError){} " ,
1064- experimentalFeatures: [ . typedThrows]
1049+ fixedSource: " func test() async throws(MyError){} "
10651050 )
10661051 }
10671052
0 commit comments