Skip to content

Commit 1eae0d7

Browse files
vtjnashstaticfloat
authored andcommitted
fix reduced_indices type bug (JuliaLang#44096)
The result is type-asserted to be equal to the input, so we need to use a non-promoting function.
1 parent aed41cf commit 1eae0d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/reducedim.jl

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function reduced_indices0(inds::Indices{N}, d::Int) where N
4444
end
4545

4646
function reduced_indices(inds::Indices{N}, region) where N
47-
rinds = [inds...]
47+
rinds = collect(inds)
4848
for i in region
4949
isa(i, Integer) || throw(ArgumentError("reduced dimension(s) must be integers"))
5050
d = Int(i)
@@ -58,7 +58,7 @@ function reduced_indices(inds::Indices{N}, region) where N
5858
end
5959

6060
function reduced_indices0(inds::Indices{N}, region) where N
61-
rinds = [inds...]
61+
rinds = collect(inds)
6262
for i in region
6363
isa(i, Integer) || throw(ArgumentError("reduced dimension(s) must be integers"))
6464
d = Int(i)

0 commit comments

Comments
 (0)