Commit e91826f
Mark
Otherwise consumers of SwiftSyntax may encounter warnings when compiling
with `-strict-concurrency=complete`.
For example:
```swift
extension DeclModifierListSyntax {
var fileprivateModifierIndex: DeclModifierListSyntax.Index? {
firstIndex(where: { $0.name.tokenKind == .keyword(.fileprivate) })
}
var fileprivateModifier: DeclModifierSyntax? {
fileprivateModifierIndex.flatMap { self[$0] }
}
func replacing(fileprivateModifierIndex: DeclModifierListSyntax.Index) -> DeclModifierListSyntax {
let fileprivateModifier = self[fileprivateModifierIndex]
return with(
\.[fileprivateModifierIndex],
fileprivateModifier.with(
\.name,
.keyword(
.private,
leadingTrivia: fileprivateModifier.leadingTrivia,
trailingTrivia: fileprivateModifier.trailingTrivia
)
)
)
}
}
```
Produces the following warning:
> cannot form key path that captures non-sendable type
> 'DeclModifierListSyntax.Index' (aka 'SyntaxChildrenIndex')SyntaxChildrenIndex as Sendable
1 parent 88ae805 commit e91826f
File tree
2 files changed
+3
-3
lines changed- Sources/SwiftSyntax
2 files changed
+3
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
0 commit comments