JuliaFolds / Transducers.jl

Efficient transducers for Julia
https://juliafolds.github.io/Transducers.jl/dev/
MIT License
432 stars 24 forks source link

tcollect and dcollect are not type-inferrable #522

Open sethaxen opened 2 years ago

sethaxen commented 2 years ago
julia> using Transducers, Test

julia> x = randn(10);

julia> iter = x |> Map(identity);

julia> @inferred collect(iter);

julia> @inferred tcollect(iter);
ERROR: return type Vector{Float64} does not match inferred return type Any
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] top-level scope
   @ REPL[20]:1

julia> @inferred dcollect(iter);
ERROR: return type Vector{Float64} does not match inferred return type Any
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:33
 [2] top-level scope
   @ REPL[21]:1

Is there a way to make them inferrable?