Skip to content

Potential addition of more strict / consistent setindex! shape rules #81

@adienes

Description

@adienes

in JuliaLang/julia#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

JuliaLang/julia#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 JuliaLang/julia#40018

the error reported was from these lines:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions