-
Notifications
You must be signed in to change notification settings - Fork 20
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
Changed meaning of .+= in Julia 0.5 #147
Comments
That's really great news! Thanks for the heads up! |
Feel free to close if your code is okay. However, as I just noticed in JuliaLang/julia#17510, because |
Yes, thanks for letting us know, lately I've been getting used to 0.5-dev breaking FixedSizeArrays without warning ;-) In the tests, the expression destructure(rgb)[fieldindex(eltype(rgb),:g), :] .+= 1 which should use a view in broadcast as it updates |
It should be fixed in JuliaLang/julia#17546 to call |
Thanks @stevengj I just checked your branch, and |
Your test code uses
x .+= y
, so you should know that in Julia 0.5 this has changed meaning to be equivalent tobroadcast!(identity, x, x .+ y)
, so that it mutates thex
array (see JuliaLang/julia#17510 … in Julia 0.6 the whole operation will occur in-place without temporaries). So.+
should only be used if the left-hand side is a mutable array, and you don't mind mutating it.At first glance, this looks like it is okay for you, because you use it in
rgb[:g,:] .+= 1
, wherergb[:g,:]
is an array that you are mutating anyway. But if it were a problem you could always change it to+=
.The text was updated successfully, but these errors were encountered: