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

[0, nothing, 0.0, missing] throws MethodError in 1.3.0-alpha.38 #32777

Closed
tkf opened this issue Aug 3, 2019 · 2 comments · Fixed by #32788
Closed

[0, nothing, 0.0, missing] throws MethodError in 1.3.0-alpha.38 #32777

tkf opened this issue Aug 3, 2019 · 2 comments · Fixed by #32788
Assignees
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@tkf
Copy link
Member

tkf commented Aug 3, 2019

julia> VERSION
v"1.3.0-alpha.38"

julia> [0, nothing, 0.0, missing]
ERROR: MethodError: convert(::Type{Union{Missing, Nothing, Float64}}, ::Int64) is ambiguous. Candidates:
  convert(::Type{Union{Missing, T}}, x) where T in Base at missing.jl:42
  convert(::Type{Union{Nothing, T}}, x) where T in Base at some.jl:23
Possible fix, define
  convert(::Type{Union{Missing, Nothing}}, ::Any)
Stacktrace:
 [1] setindex!(::Array{Union{Missing, Nothing, Float64},1}, ::Int64, ::Int64) at ./array.jl:780
 [2] copyto!(::Array{Union{Missing, Nothing, Float64},1}, ::Tuple{Int64,Nothing,Float64,Missing}) at ./abstractarray.jl:725
 [3] vect(::Int64, ::Vararg{Any,N} where N) at ./array.jl:151
 [4] top-level scope at REPL[2]:1

It works in 1.2.0-rc2.0.

@JeffBezanson
Copy link
Member

Seems to be caused by c9dd565

@JeffBezanson JeffBezanson self-assigned this Aug 3, 2019
@JeffBezanson JeffBezanson added the types and dispatch Types, subtyping and method dispatch label Aug 3, 2019
JeffBezanson added a commit that referenced this issue Aug 4, 2019
Fortunately, #32771 allows reverting the offending change.
@JeffBezanson
Copy link
Member

Note: problem exists on backports-1.2.0 branch; was introduced since rc2.

JeffBezanson added a commit that referenced this issue Aug 5, 2019
Fortunately, #32771 allows reverting the offending change.
JeffBezanson added a commit that referenced this issue Aug 5, 2019
Fortunately, #32771 allows reverting the offending change.
(cherry picked from commit c158ff2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants