File tree Expand file tree Collapse file tree 2 files changed +20
-3
lines changed
lib/ASTGen/Sources/ASTGen Expand file tree Collapse file tree 2 files changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -359,11 +359,15 @@ private enum InactiveCodeChecker {
359359 // match.
360360 switch self {
361361 case . name( let name) :
362- guard let identifier = token. identifier, identifier. name == name else {
363- continue
362+ if let identifier = token. identifier, identifier. name == name {
363+ break
364364 }
365365
366- break
366+ if case . keyword = token. tokenKind, token. text == name {
367+ break
368+ }
369+
370+ continue
367371
368372 case . tryOrThrow:
369373 guard let keywordKind = token. keywordKind,
Original file line number Diff line number Diff line change @@ -571,3 +571,16 @@ func testEnumeratedForLoop(a: [Int]) {
571571 let _ = c
572572 }
573573}
574+
575+ // https://github.com/swiftlang/swift/issues/79555
576+ final class A {
577+ var x : ( ) -> Void {
578+ { [ weak self] in // Used to warn: variable 'self' was written to, but never read
579+ #if NOT_PROCESSED
580+ self ? . f ( )
581+ #endif
582+ }
583+ }
584+
585+ func f( ) { }
586+ }
You can’t perform that action at this time.
0 commit comments