Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Piracy of map(f) #179

Closed
mcabbott opened this issue Jul 18, 2022 · 1 comment · Fixed by #180
Closed

Piracy of map(f) #179

mcabbott opened this issue Jul 18, 2022 · 1 comment · Fixed by #180

Comments

@mcabbott
Copy link
Contributor

mcabbott commented Jul 18, 2022

This package overwrites Base's behaviour for one-argument map, for example:

julia> map(println)  # calls println()


julia> using FillArrays

julia> map(println)
ERROR: MethodError: reducing over an empty collection is not allowed; consider supplying `init` to the reducer
Stacktrace:
  [1] reduce_empty(op::Base.MappingRF{typeof(length), Base.BottomRF{typeof(min)}}, #unused#::Type{Union{}})
    @ Base ./reduce.jl:356
...
  [9] mapreduce(f::Function, op::Function, itr::Tuple{})
    @ Base ./reduce.jl:302
 [10] map(::Function)
    @ FillArrays ~/.julia/packages/FillArrays/5Arin/src/fillbroadcast.jl:6

julia> @which map(println)
map(f::Function, vs::FillArrays.AbstractFill{<:Any, 1}...)
     @ FillArrays ~/.julia/packages/FillArrays/5Arin/src/fillbroadcast.jl:5

Blame points to #146 unfortunately...

@dlfivefifty
Copy link
Member

Can you produce a fix please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants