This repository has been archived by the owner on May 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
Wrong return type for .== #142
Comments
Is this perhaps related to JuliaLang/julia#17172 ? I haven't yet incorporated that fix into the |
Not sure, but certainly worth a try. |
This was referenced Nov 9, 2016
For non-numeric types this causes a julia> x = NullableVector{String}(["a", "b", "c", "d"]); x[4] = Nullable();
julia> x .== x
ERROR: MethodError: Cannot `convert` an object of type Bool to an object of type String
This may have arisen from a call to the constructor String(...),
since type constructors fall back to convert methods.
in setindex! at /Users/josh/.julia/v0.5/NullableArrays/src/indexing.jl:60 [inlined]
in _setindex! at ./multidimensional.jl:441 [inlined]
in setindex! at ./abstractarray.jl:832 [inlined]
in macro expansion at /Users/josh/.julia/v0.5/NullableArrays/src/broadcast.jl:128 [inlined]
in macro expansion at ./simdloop.jl:73 [inlined]
in macro expansion at /Users/josh/.julia/v0.5/NullableArrays/src/broadcast.jl:122 [inlined]
in #_broadcast!#20(::Bool, ::Base.Broadcast.#_broadcast!, ::Base.#==, ::NullableArrays.NullableArray{String,1}, ::Tuple{Tuple{Bool},Tuple{Bool}}, ::Tuple{Tuple{Int64},Tuple{Int64}}, ::Tuple{NullableArrays.NullableArray{String,1},NullableArrays.NullableArray{String,1}}, ::Type{Val{2}}) at /Users/josh/.julia/v0.5/NullableArrays/src/broadcast.jl:112
in (::Base.Broadcast.#kw##_broadcast!)(::Array{Any,1}, ::Base.Broadcast.#_broadcast!, ::Function, ::NullableArrays.NullableArray{String,1}, ::Tuple{Tuple{Bool},Tuple{Bool}}, ::Tuple{Tuple{Int64},Tuple{Int64}}, ::Tuple{NullableArrays.NullableArray{String,1},NullableArrays.NullableArray{String,1}}, ::Type{Val{2}}) at ./<missing>:0
in #broadcast!#22(::Bool, ::Function, ::Function, ::NullableArrays.NullableArray{String,1}, ::NullableArrays.NullableArray{String,1}, ::Vararg{NullableArrays.NullableArray{String,1},N}) at /Users/josh/.julia/v0.5/NullableArrays/src/broadcast.jl:176
in (::Base.Broadcast.#kw##broadcast!)(::Array{Any,1}, ::Base.Broadcast.#broadcast!, ::Function, ::NullableArrays.NullableArray{String,1}, ::NullableArrays.NullableArray{String,1}, ::Vararg{NullableArrays.NullableArray{String,1},N}) at ./<missing>:0
in broadcast(::Function, ::NullableArrays.NullableArray{String,1}, ::NullableArrays.NullableArray{String,1}) at ./<missing>:0
in .==(::NullableArrays.NullableArray{String,1}, ::NullableArrays.NullableArray{String,1}) at /Users/josh/.julia/v0.5/NullableArrays/src/broadcast.jl:209 |
this works now julia> using NullableArrays
julia> x = NullableArray(1:3)
3-element NullableArrays.NullableArray{Int64,1}:
1
2
3
julia> x .== x
3-element NullableArrays.NullableArray{Bool,1}:
true
true
true
julia> x = NullableArray(["a", "b", "c", Nullable()])
4-element NullableArrays.NullableArray{String,1}:
"a"
"b"
"c"
#NULL
julia> x .== x
4-element NullableArrays.NullableArray{Bool,1}:
true
true
true
#NULL |
Indeed. Likely fixed by #166. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I see this on both 0.4 and 0.5:
Looks like a problem with
broadcast
:The text was updated successfully, but these errors were encountered: