Commit 9918325
fix: preserve @anchor on first statement of enum split cases
The enum split builder's case body loop never called stmtOwnAnchor
on its statements, so any @anchor(from: …, to: …) authored on the
first activity in a case silently dropped on exec. Describe → exec
→ describe stripped the FlowAnchor entirely because the split →
first-case-activity flow carried only layout-default connection
indices.
Mirror the existing IF and inheritance-split case body loops by:
- capturing thisAnchor = stmtOwnAnchor(stmt) at the top of each
iteration;
- applying it to the split → first-case-activity flow (the last
flow that addGroupedEnumSplitFlows appended for the case value);
- carrying prevAnchor across subsequent statements and applying
applyUserAnchors(flow, prevAnchor, thisAnchor) on each
intra-case flow.
Test: TestEnumSplitBuilderPreservesFirstStatementAnchor asserts
that @anchor(to: bottom) on the first case statement lands on
the split → case flow's DestinationConnectionIndex.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent bd66c18 commit 9918325
2 files changed
Lines changed: 76 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| 363 | + | |
363 | 364 | | |
| 365 | + | |
364 | 366 | | |
365 | 367 | | |
366 | 368 | | |
| |||
371 | 373 | | |
372 | 374 | | |
373 | 375 | | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
374 | 384 | | |
| 385 | + | |
375 | 386 | | |
376 | | - | |
| 387 | + | |
377 | 388 | | |
378 | 389 | | |
379 | | - | |
| 390 | + | |
380 | 391 | | |
| 392 | + | |
| 393 | + | |
381 | 394 | | |
| 395 | + | |
382 | 396 | | |
383 | 397 | | |
384 | 398 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
0 commit comments