Skip to content

Commit

Permalink
Update comment above promote_result
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Dec 8, 2024
1 parent 8c385a8 commit 800b9d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/promotion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,11 @@ promote_rule(::Type{Bottom}, ::Type{Bottom}, slurp...) = Bottom # not strictly n
promote_rule(::Type{Bottom}, ::Type{T}, slurp...) where {T} = T
promote_rule(::Type{T}, ::Type{Bottom}, slurp...) where {T} = T

# if both the arguments are identical, or if both the orderings in promote_rule
# are defined to return identical results, we may return the result directly
promote_result(::Type{T},::Type{T},::Type{T},::Type{T}) where {T} = T
# If only one promote_rule is defined, use the definition directly
promote_result(::Type,::Type,::Type{T},::Type{T}) where {T} = T
# If only one promote_rule is defined, use the definition directly
promote_result(::Type,::Type,::Type{T},::Type{Bottom}) where {T} = T
promote_result(::Type,::Type,::Type{Bottom},::Type{T}) where {T} = T
# if multiple promote_rules are defined, try to promote the results
Expand Down

0 comments on commit 800b9d4

Please sign in to comment.