Skip to content

Commit df33dee

Browse files
simeonschaubElOceanografo
authored andcommitted
fix invalidations due to convert(Nothing, ::Any) (JuliaLang#39434)
1 parent 00ebd0c commit df33dee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

base/some.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ end
3434

3535
convert(::Type{T}, x::T) where {T>:Nothing} = x
3636
convert(::Type{T}, x) where {T>:Nothing} = convert(nonnothingtype_checked(T), x)
37+
convert(::Type{Nothing}, x) = throw(MethodError(convert, (Nothing, x)))
38+
convert(::Type{Nothing}, ::Nothing) = nothing
3739
convert(::Type{Some{T}}, x::Some{T}) where {T} = x
3840
convert(::Type{Some{T}}, x::Some) where {T} = Some{T}(convert(T, x.value))
3941

0 commit comments

Comments
 (0)