Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix definition of promote_rule(Missing, Missing) #27256

Merged
merged 1 commit into from
May 27, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix definition of promote_rule(Missing, Missing)
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 26, 2018
commit 27bc2cde95875b8d61dd8793a9ce9086a9a31371
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