#Convert + upgrade type to union

1 messages · Page 1 of 1 (latest)

pliant radish
#

Hello ! Can somebody explain why the first two lines work, but not the third one here?

convert(Float64, 1) # Convert to float.
convert(Union{Float64,String}, 1.0) # Upgrade to union.
convert(Union{Float64,String}, 1) # Cannot upgrade + convert?
#

(wops, sorry I meant to post that in #julia, but it seems I can't erase it now :(