@@ -181,22 +181,23 @@ function reducedim_init(f::ExtremaMap, op::typeof(_extrema_rf), A::AbstractArray
181
181
v0 = reverse (mapreduce (f, op, A1)) # turn minmax to maxmin
182
182
183
183
T = _realtype (f. f, promote_union (eltype (A)))
184
- Tr = v0[1 ] isa T && v0[2 ] isa T ? NTuple{2 ,T} : typeof (v0)
184
+ Tmin = v0[1 ] isa T ? T : typeof (v0[1 ])
185
+ Tmax = v0[2 ] isa T ? T : typeof (v0[2 ])
185
186
186
187
# but NaNs and missing need to be avoided as initial values
187
188
if v0[1 ] isa Number && isnan (v0[1 ])
188
189
v0 = oftype (v0[1 ], Inf ), oftype (v0[2 ], - Inf )
189
190
elseif isunordered (v0[1 ])
190
191
# v0 is missing or a third-party unordered value
191
- T1, T2 = Tr. parameters
192
192
# TODO : Some types, like BigInt, don't support typemin/typemax.
193
193
# So a Matrix{Union{BigInt, Missing}} can still error here.
194
- v0 = typemax (nonmissingtype (T1 )), typemin (nonmissingtype (T2 ))
194
+ v0 = typemax (nonmissingtype (Tmin )), typemin (nonmissingtype (Tmax ))
195
195
end
196
196
# v0 may have changed type.
197
- Tr = v0[1 ] isa T && v0[2 ] isa T ? NTuple{2 ,T} : typeof (v0)
197
+ Tmin = v0[1 ] isa T ? T : typeof (v0[1 ])
198
+ Tmax = v0[2 ] isa T ? T : typeof (v0[2 ])
198
199
199
- return reducedim_initarray (A, region, v0, Tr )
200
+ return reducedim_initarray (A, region, v0, Tuple{Tmin,Tmax} )
200
201
end
201
202
202
203
reducedim_init (f:: Union{typeof(abs),typeof(abs2)} , op:: typeof (max), A:: AbstractArray{T} , region) where {T} =
0 commit comments