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

Fix collect on stateful generator #41919

Merged
merged 2 commits into from
Aug 24, 2021
Merged

Conversation

jakobnissen
Copy link
Contributor

Fixes #35530.

base/array.jl Show resolved Hide resolved
@jakobnissen
Copy link
Contributor Author

The CI failure come from an an inference failure that reduces to this:

julia> h(x) = Array{typeof(x[]),0}
h (generic function with 1 method)

julia> only(Base.return_types(h, (Ref{Union{Nothing, Int}},)))
Type{Array{_A, 0}} where _A

I can try to work around it, but looking at it as a human, without understanding how the compiler works, it appears to be something that type inference ought to be able to figure out?

@jakobnissen
Copy link
Contributor Author

Okay I decided to work around it.

@vtjnash vtjnash merged commit 8364a4c into JuliaLang:master Aug 24, 2021
@vtjnash vtjnash added backport 1.6 Change should be backported to release-1.6 backport 1.7 labels Aug 24, 2021
KristofferC pushed a commit that referenced this pull request Aug 25, 2021
Previously this code would drop 1 from the length of some generators.

Fixes #35530

(cherry picked from commit 8364a4c)
KristofferC pushed a commit that referenced this pull request Aug 25, 2021
Previously this code would drop 1 from the length of some generators.

Fixes #35530

(cherry picked from commit 8364a4c)
KristofferC pushed a commit that referenced this pull request Aug 31, 2021
Previously this code would drop 1 from the length of some generators.

Fixes #35530

(cherry picked from commit 8364a4c)
KristofferC pushed a commit that referenced this pull request Sep 3, 2021
Previously this code would drop 1 from the length of some generators.

Fixes #35530

(cherry picked from commit 8364a4c)
@KristofferC KristofferC removed the backport 1.6 Change should be backported to release-1.6 label Sep 7, 2021
vtjnash added a commit that referenced this pull request Sep 8, 2021
vtjnash added a commit that referenced this pull request Sep 8, 2021
vtjnash added a commit that referenced this pull request Sep 9, 2021
vtjnash added a commit that referenced this pull request Sep 9, 2021
vtjnash added a commit that referenced this pull request Sep 14, 2021
KristofferC pushed a commit that referenced this pull request Sep 15, 2021
Generalization of #41919
Fixes #42168

(cherry picked from commit 68e0813)
KristofferC pushed a commit that referenced this pull request Sep 15, 2021
Generalization of #41919
Fixes #42168

(cherry picked from commit 68e0813)
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
Previously this code would drop 1 from the length of some generators.

Fixes JuliaLang#35530
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Feb 22, 2022
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
Previously this code would drop 1 from the length of some generators.

Fixes JuliaLang#35530
LilithHafner pushed a commit to LilithHafner/julia that referenced this pull request Mar 8, 2022
@jakobnissen jakobnissen deleted the fixgencollect branch September 8, 2022 14:27
staticfloat pushed a commit that referenced this pull request Dec 23, 2022
Previously this code would drop 1 from the length of some generators.

Fixes #35530

(cherry picked from commit 8364a4c)
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

Successfully merging this pull request may close these issues.

Stateful Iterator omitting last element when used in list comprehension, crashes on 1-element long vectors.
3 participants