-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
foldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.regressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version
Description
In Julia 1.12.0, the return type of count is the type of init, if present:
julia> count(iszero, Int[]; init=Int8(0)) |> typeof
Int8
julia> count(iszero, Int[1]; init=Int8(0)) |> typeof
Int8
julia> count(Bool[]; init=Int8(0)) |> typeof
Int8
julia> count(Bool[1]; init=Int8(0)) |> typeof
Int8
For master this is not the case anymore. In particular, there is now a type instability:
julia> count(iszero, Int[]; init=Int8(0)) |> typeof
Int8
julia> count(iszero, Int[1]; init=Int8(0)) |> typeof
Int64
julia> count(Bool[]; init=Int8(0)) |> typeof
Int64
julia> count(Bool[1]; init=Int8(0)) |> typeof
Int64
Julia Version 1.13.0-DEV.1323
Commit c4f28781319 (2025-10-16 18:54 UTC)
Build Info:
Official https://julialang.org release
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 4 × Intel(R) Core(TM) i3-10110U CPU @ 2.10GHz
WORD_SIZE: 64
LLVM: libLLVM-20.1.8 (ORCJIT, skylake)
GC: Built with stock GC
Metadata
Metadata
Assignees
Labels
foldsum, maximum, reduce, foldl, etc.sum, maximum, reduce, foldl, etc.regressionRegression in behavior compared to a previous versionRegression in behavior compared to a previous version