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
  • Loading branch information
vtjnash committed Aug 2, 2023
1 parent 202a64c commit edff86a
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 edff86a

Please sign in to comment.