-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Broadcasted addition of one CarteseanIndex to an array of them emits cryptic error #41540
Comments
Hah! But seriously, Does something depend on this code path emitting an error? |
I doubt it is actually necessary; i think it was just to avoid possible confusion about whether a CartesianIndex is container-like. |
So would this change be fine then? broadcastable(x::Union{Symbol,AbstractString,Function,UndefInitializer,Nothing,RoundingMode,Missing,Val,Ptr,AbstractPattern,Pair}) = Ref(x)
# to
broadcastable(x::Union{Symbol,AbstractString,Function,UndefInitializer,Nothing,RoundingMode,Missing,Val,Ptr,AbstractPattern,Pair,AbstractCartesianIndex}) = Ref(x) Since it doesn't support iteration, this seems to match what |
This would be fixed by #48404 which makes CartesianIndices broadcast scalars (but also iterable) |
If iteration across the values of CarteseanIndex is not supported, shouldn't it just treat it as an atomic value in the broadcast without the need to wrap it in
Ref()
?The text was updated successfully, but these errors were encountered: