ERROR: LoadError: MethodError: no method matching setindex_shape_check(::Int64, ::Int64, ::Int64)

Maybe this is helpful: The error comes from something like:

julia> A = zeros(2, 2);

julia> A[:,1] = 4
ERROR: MethodError: no method matching setindex_shape_check(::Int64, ::Int64, ::Int64)

e.g. you try to assign a scalar to multiple locations in A. This should be written with broadcasting in Julia 1.0:

julia> A = zeros(2, 2);

julia> A[:,1] .= 4
2-element view(::Array{Float64,2}, :, 1) with eltype Float64:
 4.0
 4.0
3 Likes