Commit 8554167
fix: treat terminal nested IF as returning in flow builder
lastStmtIsReturn only matched a literal ast.ReturnStmt as the last
statement, missing the case where a body ends in an IF whose branches
both return. The outer IF then thought its THEN branch continued,
emitted a duplicate "true" SequenceFlow plus an orphan EndEvent with
no ReturnValue, and Studio Pro rejected the file with "Sequence
contains no matching element" on any diff or microflow open.
Widen the predicate to "last stmt is a guaranteed terminator" —
RETURN, RAISE ERROR, or an IF/ELSE where every branch is terminal
(recursively). LOOP is explicitly not terminal because BREAK exits
even if the body returns.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>1 parent 96a5d9e commit 8554167
1 file changed
Lines changed: 29 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
175 | | - | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
176 | 187 | | |
177 | 188 | | |
178 | 189 | | |
179 | 190 | | |
180 | | - | |
181 | | - | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
182 | 208 | | |
0 commit comments