We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.=
Currently x .= x .+ x lowers to:
x .= x .+ x
#6 = $(Expr(:new, :(Main.:(##6#8)))) Core.SSAValue(0) = #6 (Base.broadcast!)(Core.SSAValue(0), x, x)
which is a sensible definition for mutable types. As mentioned in https://discourse.julialang.org/t/is-broadcast-supposed-to-work-on-staticarrays/9977/3 it might be beneficial (I am not a 100% on that) for immutable types to define .= as well, but the lowering get's in the way of that.
I propose that we change the lowering to:
#6 = $(Expr(:new, :(Main.:(##6#8)))) Core.SSAValue(0) = #6 x = (Base.broadcast!)(Core.SSAValue(0), x, x)
which will require broadcast! to return the argument it is modifying and would allow immutable container types to chose to implement .= as well.
broadcast!
The text was updated successfully, but these errors were encountered:
Dup of #19992
Sorry, something went wrong.
No branches or pull requests
Currently
x .= x .+ x
lowers to:which is a sensible definition for mutable types.
As mentioned in https://discourse.julialang.org/t/is-broadcast-supposed-to-work-on-staticarrays/9977/3
it might be beneficial (I am not a 100% on that) for immutable types to define
.=
as well, but the lowering get's in the way of that.I propose that we change the lowering to:
which will require
broadcast!
to return the argument it is modifying and would allow immutable container types tochose to implement
.=
as well.The text was updated successfully, but these errors were encountered: