@@ -1242,7 +1242,9 @@ for (Bsig, A1sig, A2sig, gbb, funcname) in
1242
1242
end # let broadcast_cache
1243
1243
end
1244
1244
_broadcast_zpreserving! (args... ) = broadcast! (args... )
1245
- _broadcast_zpreserving (f, As... ) = broadcast! (f, similar (Array{promote_op (f, map (eltype, As)... )}, Base. Broadcast. broadcast_indices (As... )), As... )
1245
+ # note: promote_eltype_op also deprecated, defined later in this file
1246
+ _broadcast_zpreserving (f, As... ) =
1247
+ broadcast! (f, similar (Array{_promote_eltype_op (f, As... )}, Base. Broadcast. broadcast_indices (As... )), As... )
1246
1248
_broadcast_zpreserving {Tv1,Ti1,Tv2,Ti2} (f:: Function , A_1:: SparseMatrixCSC{Tv1,Ti1} , A_2:: SparseMatrixCSC{Tv2,Ti2} ) =
1247
1249
_broadcast_zpreserving! (f, spzeros (promote_type (Tv1, Tv2), promote_type (Ti1, Ti2), Base. to_shape (Base. Broadcast. broadcast_indices (A_1, A_2))), A_1, A_2)
1248
1250
_broadcast_zpreserving {Tv,Ti} (f:: Function , A_1:: SparseMatrixCSC{Tv,Ti} , A_2:: Union{Array,BitArray,Number} ) =
@@ -1496,8 +1498,18 @@ function frexp{T<:AbstractFloat}(A::Array{T})
1496
1498
return (F, E)
1497
1499
end
1498
1500
1499
- # Calling promote_op is likely a bad idea, so deprecate its convenience wrapper promote_eltype_op
1500
- @deprecate promote_eltype_op (op, As... ) promote_op (op, map (eltype, As)... )
1501
+ # Deprecate promote_eltype_op (#19814, #19937)
1502
+ _promote_eltype_op (:: Any ) = Any
1503
+ _promote_eltype_op (op, A) = (@_inline_meta ; promote_op (op, eltype (A)))
1504
+ _promote_eltype_op (op, A, B) = (@_inline_meta ; promote_op (op, eltype (A), eltype (B)))
1505
+ _promote_eltype_op (op, A, B, C, D... ) = (@_inline_meta ; _promote_eltype_op (op, eltype (A), _promote_eltype_op (op, B, C, D... )))
1506
+ @inline function promote_eltype_op (args... )
1507
+ depwarn ("""
1508
+ `promote_eltype_op` is deprecated and should not be used.
1509
+ See https://github.com/JuliaLang/julia/issues/19669.""" ,
1510
+ :promote_eltype_op )
1511
+ _promote_eltype_op (args... )
1512
+ end
1501
1513
1502
1514
function unsafe_wrap (:: Type{String} , p:: Union{Ptr{UInt8},Ptr{Int8}} , len:: Integer , own:: Bool = false )
1503
1515
Base. depwarn (" unsafe_wrap(String, ...) is deprecated; use `unsafe_string` instead." , :unsafe_wrap )
0 commit comments