JuliaSyntax: fix anonymous function parsing
Fixes https://github.com/JuliaLang/julia/issues/60202
julia> function zip_missing(::Tuple{}, longer)
map(function (second_one)
(missing, second_one)
end, longer)
end
zip_missing (generic function with 1 method)
Written by Claude
Just for reference, @KristofferC just touched this code in https://github.com/JuliaLang/JuliaSyntax.jl/pull/580
The fix here has become quite complicated.. @c42f @KristofferC
Would it be possible to add a unit test for this? (incl. for the previous change that affected this part of the code)
Did we actually find out where the error comes from (by bisecting starting from Julia-1.12)?
There are a couple of tests added already.
I believe the issue was introduced by https://github.com/JuliaLang/JuliaSyntax.jl/pull/580
It would be great to get this in better earlier than later. As long as https://github.com/JuliaLang/julia/issues/60202 is unresolved, Unzip.jl won't precompile, including all of its dependents (which e.g. contain Plots.jl and thus a rather large fraction of the ecosystem), and any nanosoldier runs for other changes in nightly won't check these packages at all
Agreed. This still needs review by someone familiar with JuliaSyntax for the general approach.