ITADN

Potential addition of more strict / consistent `setindex!` shape rules

#81Closedadienes 创建于 2025-07-23
bug
A
adienescommented
in https://github.com/JuliaLang/julia/issues/40018, there is some discussion observing that the documented behavior of `setindex!` is inconsistent with its implementation (namely: the implementation is more relaxed about mushing heterogenous shapes together). but so far discussion participants seem to be in agreement that the documented behavior is more consistent, both in isolation as well as when considered alongside other indexing constructs in the language https://github.com/JuliaLang/julia/pull/59025 would resolve the inconsistency by making some previously non-erroring paths into a `DimensionMismatch`. this package was flagged during a PkgEval run as one that may be affected by this change. if you're amenable to conforming the usage of `setindex!` to its documentation, I'm happy to help where I can. otherwise, I would recommend voicing the disagreement in https://github.com/JuliaLang/julia/issues/40018 the error reported was from [these lines](https://github.com/SciML/EllipsisNotation.jl/blob/38fa48aedce200d213ff47235e6ae25b7859627b/test/basic.jl#L25C1-L31C7): ``` A[1, ..] = reshape([3 4 5 6 4 5 6 7], 1, 4, 2) ``` which now are `ERROR: LoadError: DimensionMismatch: tried to assign 1×4×2 array to 4×2 destination`
关闭于 2025-09-05 1 条评论