Commit a0083b4
JuliaLowering: Reject duplicate field names in struct definitions (#61471)
The flisp lowerer reports an error for `struct A; x; x; end`, but
JuliaLowering did not have an explicit check. The duplicate was only
caught later as a "function argument name not unique" error during
constructor generation, which was confusing.
Add an explicit check in `_collect_struct_fields` that throws a
`LoweringError` with the same message format as flisp when a duplicate
field name is encountered.
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Em Chu <61633163+mlechu@users.noreply.github.com>1 parent d803fc3 commit a0083b4
File tree
3 files changed
+34
-0
lines changed- JuliaLowering
- src
- test
3 files changed
+34
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3201 | 3201 | | |
3202 | 3202 | | |
3203 | 3203 | | |
| 3204 | + | |
| 3205 | + | |
| 3206 | + | |
| 3207 | + | |
| 3208 | + | |
3204 | 3209 | | |
3205 | 3210 | | |
3206 | 3211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
451 | 456 | | |
452 | 457 | | |
453 | 458 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1370 | 1370 | | |
1371 | 1371 | | |
1372 | 1372 | | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
0 commit comments