Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't specialize groupreduce! on result array element type
Works around crash seen in #2326. The inferred return type of `groupreduce_init` is `Union{Vector{Any}, SentinelVector{Float64}}` and it seems the compiler then crashes when trying to correctly identify `U` from that union of types. Part of my conclusion here is based on the fact that if you remove all other argument type constraints and just make `groupreduce!` return `res` directly, it still crashes; thus, by deduction, the crash has something to do with the compiler having trouble with the `::AbstractVector{U}` argument type constraint/specialization. The work-around is pretty uncontroversial; we were already calling `eltype(res)` in several other places, and I've checked that it infers the same. I didn't add a test since this seems like such an obscure compiler bug that it doesn't really seem necessary for DataFrames to be testing core compiler behavior. Also note that this bug exists in Julia <= 1.5, so current Julia master (pending 1.6), which includes a number of compiler refactorings/changes, seems to have resolved whatever the issue was. cc: @Keno, @vtjnash, @JeffBezanson
- Loading branch information