Skip to content

map! doesn't check for dimension mismatch #56696

@LilithHafner

Description

@LilithHafner
julia> map(+, [1 2 3 4], [1 2; 3 4])
ERROR: DimensionMismatch: a has size (1, 4), b has size (2, 2), mismatch at dim 1
[...]

julia> map!(+, [1 2 3 4], [1 2 3 4], [1 2; 3 4])
1×4 Matrix{Int64}:
 2  5  5  8

help?> map!
search: map! map pop! mark max clamp!

  map!(function, destination, collection...)

  Like map, but stores the result in destination rather than a new collection.
  destination must be at least as large as the smallest collection.
[...]

help?> map
search: map map! max mark imag

  map(f, A::AbstractArray...) -> N-array

  When acting on multi-dimensional arrays of the same ndims, they must all
  have the same axes, and the answer will too.
[...]

Metadata

Metadata

Assignees

No one assigned

    Labels

    arrays[a, r, r, a, y, s]bugIndicates an unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions