File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -330,9 +330,10 @@ void StmtEmitter::visitBraceStmt(BraceStmt *S) {
330
330
continue ;
331
331
}
332
332
} else if (auto D = ESD.dyn_cast <Decl*>()) {
333
- // Local type declarations are not unreachable because they can appear
334
- // after the declared type has already been used.
335
- if (isa<TypeDecl>(D))
333
+ // Local declarations aren't unreachable - only their usages can be. To
334
+ // that end, we only care about pattern bindings since their
335
+ // initializer expressions can be unreachable.
336
+ if (!isa<PatternBindingDecl>(D))
336
337
continue ;
337
338
}
338
339
Original file line number Diff line number Diff line change @@ -154,4 +154,5 @@ func sr13639() -> Int {
154
154
// CHECK: sil private @$s16unreachable_code7sr13639SiyF3FooL_V7fooFuncyyF : $@convention(method) (Foo) -> ()
155
155
func fooFunc( ) { }
156
156
}
157
+ func appendix( ) { } // no-warning
157
158
}
You can’t perform that action at this time.
0 commit comments