File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -614,7 +614,11 @@ return non-nil."
614
614
" isolated" " each" ))
615
615
(member (swift-mode:token:text next-token)
616
616
'(" any" " some" " inout" " borrowing" " consuming" " throws"
617
- " rethrows" " in" " where" " isolated" " each" )))
617
+ " rethrows" " in" " where" " isolated" " each" ))
618
+
619
+ ; ; Suppress implicit semicolon between throws and open parenthesis.
620
+ (and (equal (swift-mode:token:text previous-token) " throws" )
621
+ (eq (swift-mode:token:type next-token) '\( )))
618
622
nil )
619
623
620
624
; ; Before async
Original file line number Diff line number Diff line change @@ -489,6 +489,17 @@ func foo
489
489
) {
490
490
}
491
491
492
+ func foo( )
493
+ throws
494
+ (
495
+ any
496
+ Error
497
+ )
498
+ ->
499
+ Int {
500
+ 1
501
+ }
502
+
492
503
// Enumeration declarations
493
504
494
505
fileprivate
Original file line number Diff line number Diff line change @@ -1228,6 +1228,18 @@ catch
1228
1228
foo ( )
1229
1229
}
1230
1230
1231
+ do
1232
+ throws
1233
+ (
1234
+ any
1235
+ Error
1236
+ ) {
1237
+ foo ( )
1238
+ } catch
1239
+ let
1240
+ e {
1241
+ }
1242
+
1231
1243
// Multi-Pattern Catch Clauses
1232
1244
// https://github.com/apple/swift-evolution/blob/master/proposals/0276-multi-pattern-catch-clauses.md
1233
1245
You can’t perform that action at this time.
0 commit comments