introducing a local variable that overrides a global handle breaks things
edge case syntaxerror messages
```
julia> using ResumableFunctions
julia> f() = 1
f (generic function with 1 method)
julia> @resumable function resfun()
f = f()
@yield 2
end
resfun (generic function with 1 method)
julia> collect(resfun())
ERROR: UndefRefError: access to undefined reference
Stacktrace:
[1] getproperty
@ ./Base.jl:49 [inlined]
[2] ##resfun_FSMI#231
@ ~/Documents/ScratchSpace/quantumjulia/ResumableFunctions.jl/src/macro.jl:2 [inlined]
[3] ##resfun_FSMI#231
@ ~/Documents/ScratchSpace/quantumjulia/ResumableFunctions.jl/src/macro.jl:213 [inlined]
[4] iterate (repeats 2 times)
@ ~/Documents/ScratchSpace/quantumjulia/ResumableFunctions.jl/src/types.jl:24 [inlined]
[5] _collect(cont::UnitRange{Int64}, itr::var"##resfun_FSMI#231"{Union{}}, ::Base.HasEltype, isz::Base.SizeUnknown)
@ Base ./array.jl:727
[6] collect(itr::var"##resfun_FSMI#231"{Union{}})
@ Base ./array.jl:716
[7] top-level scope
@ REPL[4]:1
```
found by @hanakl
关闭于 2025-02-07 3 条评论