Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d0d2ece

Browse filesBrowse files
committed
1 parent 9e14a73 commit d0d2ece
Copy full SHA for d0d2ece

File tree

Expand file treeCollapse file tree

2 files changed

+31
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+31
-3
lines changed
Open diff view settings
Collapse file

‎swift-mode-indent.el‎

Copy file name to clipboardExpand all lines: swift-mode-indent.el
+2-3Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1652,7 +1652,7 @@ It is a Generic parameter list if:
16521652
"consume" "copy" "discard"
16531653
"in"
16541654
"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"
16561656
"guard" "break" "continue" "fallthrough" "return" "throw" "defer"
16571657
"do" "catch" "import" "typealias" "associatedtype"))
16581658

@@ -1672,8 +1672,7 @@ UNMATCHING-BRACKET-TEXT is a text of the current bracket."
16721672
(cond
16731673
((or (memq (swift-mode:token:type next-token) prohibited-tokens)
16741674
(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)))
16771676
;; Not a generic parameter list. Returns to the initial position and
16781677
;; stops the loop.
16791678
(goto-char pos)
Collapse file

‎test/swift-files/indent/types.swift‎

Copy file name to clipboardExpand all lines: test/swift-files/indent/types.swift
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,3 +299,32 @@ let foo: protocol<
299299
B
300300
>
301301
= 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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.