Skip to content

Commit

Permalink
Fix definition of promote_rule(Missing, Missing)
Browse files Browse the repository at this point in the history
I don't believe this definition is ever actually used (because `promote_type(::Type{T}, ::Type{T}) where {T}` would intercept it earlier), but it is still useful for preventing the ambiguities test to complain. As such, we might as well make it correct.
  • Loading branch information
Keno committed May 25, 2018
1 parent 779cf84 commit 50bd312
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/missing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ for U in (:Nothing, :Missing)
promote_rule(::Type{Union{S,$U}}, ::Type{T}) where {T,S} = Union{promote_type(T, S), $U}
promote_rule(::Type{Any}, ::Type{$U}) = Any
promote_rule(::Type{$U}, ::Type{Any}) = Any
promote_rule(::Type{$U}, ::Type{$U}) = U
# This definition is never actually used, but disambiguates the above definitions
promote_rule(::Type{$U}, ::Type{$U}) = $U
end
end
promote_rule(::Type{Union{Nothing, Missing}}, ::Type{Any}) = Any
Expand Down

0 comments on commit 50bd312

Please sign in to comment.