Skip to content

Conversation

@jishnub
Copy link
Member

@jishnub jishnub commented Mar 12, 2021

Fixes #39995

Now

julia> reduce(+, big(1):big(2), dims = 1)
1-element Vector{BigInt}:
 3

@jishnub jishnub changed the title Fix reduced_index for BigInt UnitRanges Fix reduced_index for Integer UnitRanges having eltypes other than Int Mar 13, 2021
@jishnub
Copy link
Member Author

jishnub commented Mar 13, 2021

This also fixes some other reductions that use non-Int axes

Before (using the 32-bit build of Julia):

julia> Int
Int32

julia> reduce(+, Int64(5):Int64(6), dims = 1)
ERROR: TypeError: in typeassert, expected Tuple{Base.OneTo{Int64}}, got a value of type Tuple{Base.OneTo{Int32}}

After:

julia> reduce(+, Int64(5):Int64(6), dims = 1)
1-element Array{Int64,1}:
 11

@kshyatt
Copy link
Member

kshyatt commented Apr 13, 2021

Is this good to go?

@jishnub
Copy link
Member Author

jishnub commented Apr 14, 2021

Yes, this is ready

@jishnub
Copy link
Member Author

jishnub commented Apr 28, 2021

Gentle bump, would be nice to have this fixed

@simeonschaub simeonschaub added bugfix This change fixes an existing bug merge me PR is reviewed. Merge when all tests are passing labels Apr 28, 2021
@musm musm merged commit 0470565 into JuliaLang:master Apr 28, 2021
@musm musm removed the merge me PR is reviewed. Merge when all tests are passing label Apr 28, 2021
@jishnub jishnub deleted the reducedindexBigInt branch April 28, 2021 15:22
ElOceanografo pushed a commit to ElOceanografo/julia that referenced this pull request May 4, 2021
JuliaLang#39999)

* reduced_index for BigInt UnitRanges

* Add tests for Integer subtypes

* use OneTo constructor instead of typeof

Co-authored-by: Simeon Schaub <[email protected]>

Co-authored-by: Simeon Schaub <[email protected]>
jarlebring pushed a commit to jarlebring/julia that referenced this pull request May 4, 2021
JuliaLang#39999)

* reduced_index for BigInt UnitRanges

* Add tests for Integer subtypes

* use OneTo constructor instead of typeof

Co-authored-by: Simeon Schaub <[email protected]>

Co-authored-by: Simeon Schaub <[email protected]>
antoine-levitt pushed a commit to antoine-levitt/julia that referenced this pull request May 9, 2021
JuliaLang#39999)

* reduced_index for BigInt UnitRanges

* Add tests for Integer subtypes

* use OneTo constructor instead of typeof

Co-authored-by: Simeon Schaub <[email protected]>

Co-authored-by: Simeon Schaub <[email protected]>
johanmon pushed a commit to johanmon/julia that referenced this pull request Jul 5, 2021
JuliaLang#39999)

* reduced_index for BigInt UnitRanges

* Add tests for Integer subtypes

* use OneTo constructor instead of typeof

Co-authored-by: Simeon Schaub <[email protected]>

Co-authored-by: Simeon Schaub <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix This change fixes an existing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug in evaluating reduced indices with BigInt UnitRange arguments

6 participants