File tree Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Expand file tree Collapse file tree 2 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -1652,7 +1652,7 @@ It is a Generic parameter list if:
1652
1652
" consume" " copy" " discard"
1653
1653
" in"
1654
1654
" init" " deinit" " get" " set" " willSet" " didSet" " subscript"
1655
- " for" " case" " default" " while" " let " " var" " repeat" " if" " else"
1655
+ " for" " case" " default" " while" " var" " repeat" " if" " else"
1656
1656
" guard" " break" " continue" " fallthrough" " return" " throw" " defer"
1657
1657
" do" " catch" " import" " typealias" " associatedtype" ))
1658
1658
@@ -1672,8 +1672,7 @@ UNMATCHING-BRACKET-TEXT is a text of the current bracket."
1672
1672
(cond
1673
1673
((or (memq (swift-mode:token:type next-token) prohibited-tokens)
1674
1674
(member (swift-mode:token:text next-token) prohibited-tokens)
1675
- (string-match-p " ^[\" $0-9]"
1676
- (swift-mode:token:text next-token)))
1675
+ (string-match-p " ^[\" $]" (swift-mode:token:text next-token)))
1677
1676
; ; Not a generic parameter list. Returns to the initial position and
1678
1677
; ; stops the loop.
1679
1678
(goto-char pos)
Original file line number Diff line number Diff line change @@ -299,3 +299,32 @@ let foo: protocol<
299
299
B
300
300
>
301
301
= a
302
+
303
+ // Integer generic parameters
304
+ // https://github.com/swiftlang/swift-evolution/blob/main/proposals/0452-integer-generic-parameters.md
305
+
306
+ struct Foo <
307
+ let
308
+ x
309
+ :
310
+ Int ,
311
+ let
312
+ y
313
+ :
314
+ Int
315
+ > {
316
+ func foo( ) {
317
+ }
318
+ }
319
+
320
+ extension Foo
321
+ where x == y {
322
+ func bar( ) {
323
+ }
324
+ }
325
+
326
+ let x : Foo < 1 , 2 >
327
+ = Foo< 1 , 2 > ( )
328
+
329
+ let x : Foo < - 1 , - 2 >
330
+ = Foo<- 1 , - 2 > ( ) // swift-mode:test:known-bug
You can’t perform that action at this time.
0 commit comments