A[2,:] = 5;

I have code with a lot of statements like

A = zeros(Float64,10,10);
A[2,:] = 5;

which worked fine in Julia 0.6.2. It gets this error message:

MethodError: no method matching setindex_shape_check(::Int64, ::Int64, ::Int64)
Closest candidates are:
setindex_shape_check(!Matched::AbstractArray{#s57,1} where #s57, ::Integer, ::Integer) at indices.jl:221
setindex_shape_check(!Matched::AbstractArray{#s57,2} where #s57, ::Integer, ::Integer) at indices.jl:225
setindex_shape_check(!Matched::AbstractArray, ::Integer…) at indices.jl:179

in Julia 1.0.1.
Is there still a way to do this in Julia 1.x? Thanks!

Use .= instead of =

1 Like

Another comment that is important here. If you are updating code to work with Julia v1.0, please consider updating the code with Julia v0.7. It will show you all the changes you need to do instead of this cryptic error message.

5 Likes

Thanks!