Open bramtayl opened 5 years ago
This corresponds to a TODO in the apply_type tfunc: https://github.com/JuliaLang/julia/blob/master/base/compiler/tfuncs.jl#L998. However, I think there is a larger question of whether putting the union on the outside of the closure is really the right thing to do. Perhaps there is a lowering that would allow small unions as the field type for closures.
I used this to get around it:
partial_map(f, fixed, variables::Tuple{}) = ()
partial_map(f, fixed, variables::Tuple) =
f(fixed, variables[1]), partial_map(f, fixed, tail(variables))...
partial_map(f, fixed, ::Tuple{}, ::Tuple{}) = ()
partial_map(f, fixed, variables1::Tuple, variables2::Tuple) =
f(fixed, variables1[1], variables2[1]),
partial_map(f, fixed, tail(variables1), tail(variables2))...
I watched the JuliaCon talk where @StefanKarpinski mentioned prioritizing making Julia faster for tabular data and I think solving this would be an important step