Skip to content

Commit

Permalink
cat: remove unused promote_eltype methods that confuse inference (#50753
Browse files Browse the repository at this point in the history
)

These cannot be reached, but they would imply this function might return
Bottom, which it cannot.

Fix #50550

(cherry picked from commit edff86a)
  • Loading branch information
vtjnash authored and JeffBezanson committed Aug 24, 2023
1 parent c1126a3 commit 0e01cb5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1584,10 +1584,12 @@ replace_in_print_matrix(A::AbstractVector,i::Integer,j::Integer,s::AbstractStrin
eltypeof(x) = typeof(x)
eltypeof(x::AbstractArray) = eltype(x)

promote_eltypeof() = Bottom
promote_eltypeof() = error()
promote_eltypeof(v1) = eltypeof(v1)
promote_eltypeof(v1, vs...) = promote_type(eltypeof(v1), promote_eltypeof(vs...))

promote_eltype() = Bottom
promote_eltype() = error()
promote_eltype(v1) = eltype(v1)
promote_eltype(v1, vs...) = promote_type(eltype(v1), promote_eltype(vs...))

#TODO: ERROR CHECK
Expand Down

0 comments on commit 0e01cb5

Please sign in to comment.