I ran into an issue where I expected
min.(1,f) to be lowered to
broadcast(min,1,f), but instead it is lowered to
broadcast(x->min(1,x),f). There are a few issues with this behaviour:
- It breaks the “semantic” contract of broadcasting.
- Every constant needs to recompile.
- In my case,
Fun, and I want to override
broadcast(::typeof(min),::Number,::Fun)to calculate break points. This override is not called with the current behaviour. (The current approach of overriding
min(::Number,::Fun)works, but it’s breaking the expected behaviour of
minto return one of the arguments.)
Is there an argument in favour of the current approach? Or should I create an Issue on GitHub?