Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map doesn't stop on exhausted tuple #49291

Closed
jariji opened this issue Apr 8, 2023 · 3 comments
Closed

map doesn't stop on exhausted tuple #49291

jariji opened this issue Apr 8, 2023 · 3 comments

Comments

@jariji
Copy link
Contributor

jariji commented Apr 8, 2023

  map(f, c...) -> collection


  Transform collection c by applying f to each element. For multiple collection arguments, apply f
  elementwise, and stop when when any of them is exhausted.

julia> map(==, [10], [10,11])
1-element Vector{Bool}:
 1

julia> map(==, (10,), (10,11))
ERROR: BoundsError: attempt to access Tuple{} at index [1]
@Seelengrab
Copy link
Contributor

This seems to be explicitly being tested for:

julia/test/tuple.jl

Lines 268 to 269 in 804da71

@test_throws BoundsError map(foo, (), (1,))
@test_throws BoundsError map(foo, (1,), ())

Though I don't know why.

@N5N3
Copy link
Member

N5N3 commented Apr 8, 2023

Duplicated with #42216

@JeffBezanson
Copy link
Member

Closing as duplicate of #42216

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants