Commit 056ec9d
committed
fix(flow): reuse ordered return analysis for loop exits
Replace the old missing-return special cases with the same ordered block
walker used for inferred returns. This avoids false MissingReturn
diagnostics for functions that return from truthy while/repeat loops,
keeps break and repeat-until flow consistent across inference and
diagnostics, and adds regressions for closure returns, diagnostics, and
module exports.1 parent 420edbc commit 056ec9d
10 files changed
Lines changed: 631 additions & 227 deletions
File tree
- crates/emmylua_code_analysis/src
- compilation
- analyzer
- lua
- test
- diagnostic
- checker
- test
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
| |||
189 | 194 | | |
190 | 195 | | |
191 | 196 | | |
192 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
193 | 203 | | |
194 | 204 | | |
195 | 205 | | |
| |||
0 commit comments