julia
e8667fb0 - Avoid method instance normalization for opaque closure methods (#59772)

Commit
74 days ago
Avoid method instance normalization for opaque closure methods (#59772) Fixes #59222. This issue was caused by a mismatch with `jl_new_opaque_closure_from_code_info_in_world` filling in the unnormalized method instance, and `new_opaque_closure` getting its `spec_ptr` from the normalized one via `jl_compile_method_internal`. For example, `g(xs...)` specialized as `g(:a, :b)` resulted in a different method instance than the corresponding normalized one: ```julia Tuple{Tuple{typeof(Main.g)}, Symbol, Symbol} # unnormalized Tuple{Tuple{typeof(Main.g)}, Symbol, Vararg{Symbol}} # normalized ``` Here I chose to align on using the unnormalized one from the `CodeInfo` at `OpaqueClosure` construction (the fix being a single-line change in that case), but we could also choose the normalized one if that is deemed preferable, so long as we use the same when storing the inferred code and when retrieving the `spec_ptr`. --- 🤖 Generated with some assistance from Claude Code.
Author
Parents
Loading