Commit 1d09c06
committed
LifetimeDependenceDiagnostics: diagnose indirect closure results.
Add support for diagnosing calls to closures that return a generic
non-Escapable result.
Closures do not yet model lifetime dependencies. The diagnostics have
a special case for handling nonescaple result with no lifetime
dependence, but it previously only handled direct results. This fix handles
cases like the following:
func callIndirectClosure<T>(f: () -> NE<T>) -> NE<T> {
f()
}
Fixes rdar://134318846 ([nonescapable] diagnose function types with nonescapable results)1 parent dd57d4d commit 1d09c06
File tree
2 files changed
+16
-15
lines changed- SwiftCompilerSources/Sources/Optimizer
- FunctionPasses
- Utilities
2 files changed
+16
-15
lines changedLines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
78 | 78 | | |
79 | | - | |
80 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
81 | 85 | | |
82 | 86 | | |
83 | 87 | | |
| |||
Lines changed: 7 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
| 168 | + | |
171 | 169 | | |
172 | 170 | | |
173 | 171 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
| 172 | + | |
| 173 | + | |
178 | 174 | | |
179 | 175 | | |
180 | 176 | | |
| |||
578 | 574 | | |
579 | 575 | | |
580 | 576 | | |
581 | | - | |
582 | | - | |
| 577 | + | |
| 578 | + | |
583 | 579 | | |
584 | 580 | | |
585 | 581 | | |
| |||
974 | 970 | | |
975 | 971 | | |
976 | 972 | | |
977 | | - | |
| 973 | + | |
| 974 | + | |
978 | 975 | | |
979 | 976 | | |
980 | 977 | | |
| |||
0 commit comments