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(+, 1, (1, 2, 3)) succeeds #20930

Closed
Sacha0 opened this issue Mar 7, 2017 · 3 comments
Closed

map(+, 1, (1, 2, 3)) succeeds #20930

Sacha0 opened this issue Mar 7, 2017 · 3 comments
Labels
domain:collections Data structures holding multiple items, e.g. sets kind:bug Indicates an unexpected problem or unintended behavior

Comments

@Sacha0
Copy link
Member

Sacha0 commented Mar 7, 2017

... returning Vector{Int}(2). A consequence of zip's truncation behavior and the absence of an argument shape check in the entry point to map I imagine? Should this behavior change? Best!

@ararslan ararslan added the domain:collections Data structures holding multiple items, e.g. sets label Mar 7, 2017
@dlfivefifty
Copy link
Contributor

dlfivefifty commented Jun 16, 2017

I think this is essentially the same issue: for custom iterators, map doesn't check bounds (on 0.6-rc1):

immutable FooIterator end

Base.start(::FooIterator) = 1
Base.next(::FooIterator,st) = st,st+1
Base.done(::FooIterator,st) = st  3
Base.length(::FooIterator) = 2
Base.eltype(::FooIterator) = Int

map((x,y)->x,[0.,0.,1.],FooIterator())  # succeeds

@martinholters
Copy link
Member

Ref. #20499, especially #20499 (comment).

@oscardssmith oscardssmith added the kind:bug Indicates an unexpected problem or unintended behavior label Dec 8, 2020
@vtjnash
Copy link
Sponsor Member

vtjnash commented Jan 24, 2023

Not currently a bug, just how map and zip are currently defined in v1

@vtjnash vtjnash closed this as completed Jan 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:collections Data structures holding multiple items, e.g. sets kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

6 participants