Commit 728f90c
JuliaLowering: Set
globals in begin blocks
When a variable is assigned at toplevel within a `begin` block
and then reassigned inside a permeable scope (for/while/try)
in the same block, the inner assignment was creating a plain
local without setting `is_ambiguous_local`. This happened
because the variable was already resolved as `:global` (from
the toplevel assignment), so scope resolution took the
`b.kind === :global` path instead of the `b === nothing` path
where `is_ambiguous_local` was originally set.
Now the `b.kind === :global` fallback also sets
`is_ambiguous_local` when the scope is permeable and the
variable is in `soft_assignable_globals`.
The tests directly inspect `BindingInfo.is_ambiguous_local`
via `resolve_scopes` rather than testing observable runtime
behavior, because `is_ambiguous_local` is currently metadata
only — the runtime warning that flisp emitted for this case
has not yet been ported to JuliaLowering. The flag's primary
consumer is JETLS, which uses it to emit editor diagnostics.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>is_ambiguous_local for toplevel-assigned1 parent a0083b4 commit 728f90c
2 files changed
+74
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
| 324 | + | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
346 | 418 | | |
347 | 419 | | |
348 | 420 | | |
| |||
0 commit comments