julia
6e2e6d00 - when widening tuple types in tmerge, only widen the complex parts (#50929)

Commit
2 years ago
when widening tuple types in tmerge, only widen the complex parts (#50929) This is the part of https://github.com/JuliaLang/julia/pull/50927 required to fix https://github.com/JuliaLang/julia/issues/49249. Specifically, before this change `tmerge(Tuple{Any, Int}, Nothing)` would be `Union{Nothing, Tuple{Any, Int}}` but `tmerge(Tuple{BIG_UNION, Int}, Nothing)` would be `Union{Nothing, Tuple{Any, Any}}`. This feels bad intuitively because giving the compiler more type information led it to forget type information that it already knew about, and is especially damaging because it led to unnecessary type instability when iterating tuples with complex element types (because the iterator state should be inferrable as an `Int` even if you have no idea what the tuple type is). This is tagged for backport to 1.10 since it is a relatively unobtrusive change and it fixes the string regression in a more proper way.
Author
Parents
Loading