Skip to content

Commit 0e01cb5

Browse files
vtjnashJeffBezanson
authored andcommitted
cat: remove unused promote_eltype methods that confuse inference (#50753)
These cannot be reached, but they would imply this function might return Bottom, which it cannot. Fix #50550 (cherry picked from commit edff86a)
1 parent c1126a3 commit 0e01cb5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

base/abstractarray.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1584,10 +1584,12 @@ replace_in_print_matrix(A::AbstractVector,i::Integer,j::Integer,s::AbstractStrin
15841584
eltypeof(x) = typeof(x)
15851585
eltypeof(x::AbstractArray) = eltype(x)
15861586

1587-
promote_eltypeof() = Bottom
1587+
promote_eltypeof() = error()
1588+
promote_eltypeof(v1) = eltypeof(v1)
15881589
promote_eltypeof(v1, vs...) = promote_type(eltypeof(v1), promote_eltypeof(vs...))
15891590

1590-
promote_eltype() = Bottom
1591+
promote_eltype() = error()
1592+
promote_eltype(v1) = eltype(v1)
15911593
promote_eltype(v1, vs...) = promote_type(eltype(v1), promote_eltype(vs...))
15921594

15931595
#TODO: ERROR CHECK

0 commit comments

Comments
 (0)