Skip to content

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

@tkf

Description

@tkf
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.

Metadata

Metadata

Assignees

Labels

types and dispatchTypes, subtyping and method dispatch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions