Skip to content

Closest method algo#12

Open
adienes wants to merge 4 commits into
masterfrom
closest_method_algo
Open

Closest method algo#12
adienes wants to merge 4 commits into
masterfrom
closest_method_algo

Conversation

@adienes

@adienes adienes commented May 7, 2026

Copy link
Copy Markdown
Owner

No description provided.

adienes pushed a commit that referenced this pull request May 30, 2026
…uliaLang#61939)

Fix JuliaLang#33457.  Nightly:

```
julia> begin
       # line 2
       [y for _ in 1:10]
       # line 4
       end
ERROR: UndefVarError: `y` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] #2
   @ ./none:-1 [inlined]
 [2] iterate
   @ ./generator.jl:48 [inlined]
 [3] collect(itr::Base.Generator{UnitRange{Int64}, var"#2#3"})
   @ Base ./array.jl:833
 [4] top-level scope
   @ REPL[1]:3
```

This change:
```
ERROR: UndefVarError: `y` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] #12
   @ ./REPL[1]:3 [inlined]
 [2] iterate
   @ ./generator.jl:48 [inlined]
 [3] collect(itr::Base.Generator{UnitRange{Int64}, var"#12#13"})
   @ Base ./array.jl:833
 [4] top-level scope
   @ REPL[1]:3
```

As a sneak peek, this is further improved with JuliaLang#61699:
```
ERROR: UndefVarError: `y` not defined in `Main`
Suggestion: check for spelling errors or missing imports.
Stacktrace:
 [1] (::var"#12#13")(::Int64)
   @ Main REPL[1]:3 [inlined]
 [2] iterate(::Base.Generator{UnitRange{Int64}, var"#12#13"})
   @ Base generator.jl:48 [inlined]
 [3] collect(itr::Base.Generator{UnitRange{Int64}, var"#12#13"})
   @ Base array.jl:833
 [4] top-level scope
   @ REPL[1]:3
```


I doubt this frame is important (it being a lambda is considered an
implementation detail IIRC) but (1) we shouldn't show users a nonsense
frame,
and (2) this fixes another case where we produce malformed DebugInfo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant