Skip to content

Commit

Permalink
add a nop conversion for some (#31536)
Browse files Browse the repository at this point in the history
  • Loading branch information
KristofferC authored Mar 29, 2019
1 parent 9f125f9 commit 4b12302
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions base/some.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ promote_rule(::Type{Some{T}}, ::Type{Some{S}}) where {T, S<:T} = Some{T}
promote_rule(::Type{Some{T}}, ::Type{Nothing}) where {T} = Union{Some{T}, Nothing}

convert(::Type{Some{T}}, x::Some) where {T} = Some{T}(convert(T, x.value))
convert(::Type{Some{T}}, x::Some{T}) where {T} = x
convert(::Type{Union{Some{T}, Nothing}}, x::Some) where {T} = convert(Some{T}, x)

convert(::Type{Union{T, Nothing}}, x::Union{T, Nothing}) where {T} = x
Expand Down

0 comments on commit 4b12302

Please sign in to comment.