We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
if one e.g. vcats two arrays of ShortStrings the result should be an array of ShortStrings of the larger size.
vcat
ShortString
ShortStrings
Like for the integers that back them:
julia> vcat(Int16[1,2,3], Int64[1,2,3]) 6-element Vector{Int64}: 1 2 3 1 2 3
We want the same for ShortStrings
julia> vcat(ShortString3["ab", "cd"], ShortString7["abcd", "efgc"]) ERROR: MethodError: promote_rule(::Type{Union{}}, ::Type{UInt64}) is ambiguous. Candidates: promote_rule(::Type{var"#s818"} where var"#s818"<:AbstractIrrational, ::Type{T}) where T<:Real in Base at irrationals.jl:42 promote_rule(::Type{S}, ::Type{T}) where {S<:AbstractIrrational, T<:Number} in Base at irrationals.jl:43 promote_rule(::Type{X}, ::Type{Y}) where {X<:Union{BitIntegers.AbstractBitSigned, BitIntegers.AbstractBitUnsigned}, Y<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8, BitIntegers.AbstractBitSigned, BitIntegers.AbstractBitUnsigned}} in BitIntegers at /Users/oxinabox/.julia/packages/BitIntegers/fcpdN/src/BitIntegers.jl:223 Possible fix, define promote_rule(::Type{Union{}}, ::Type{Y}) where Y<:Union{Int128, Int16, Int32, Int64, Int8, UInt128, UInt16, UInt32, UInt64, UInt8, BitIntegers.AbstractBitSigned, BitIntegers.AbstractBitUnsigned} Stacktrace: [1] promote_rule(#unused#::Type{ShortString{Union{}}}, #unused#::Type{ShortString7}) @ ShortStrings ~/.julia/packages/ShortStrings/qiyr7/src/base.jl:67 [2] promote_type @ ./promotion.jl:233 [inlined] [3] promote_result @ ./promotion.jl:247 [inlined] [4] promote_type @ ./promotion.jl:233 [inlined] [5] promote_eltype(v1::Vector{ShortString3}, vs::Vector{ShortString7}) @ Base /usr/local/src/julia/julia-master/base/abstractarray.jl:1413 [6] vcat(::Vector{ShortString3}, ::Vector{ShortString7}) @ SparseArrays /usr/local/src/julia/julia-master/usr/share/julia/stdlib/v1.6/SparseArrays/src/sparsevector.jl:1113 [7] top-level scope @ REPL[19]:1
Behavour is correct for vcating Vector{String} to Vector{ShortSting3} though. That does promote to String
Vector{String}
Vector{ShortSting3}
String
julia> vcat(ShortString3["ab", "cd"], ["abcd", "efgc"]) 4-element Vector{String}: "ab" "cd" "abcd" "efgc"
This requires #18 to be efficient
The text was updated successfully, but these errors were encountered:
ShortString{Union{}}
what I don't understand is , where does this come from?
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
if one e.g.
vcat
s two arrays ofShortString
s the result should be an array ofShortStrings
of the larger size.Like for the integers that back them:
We want the same for ShortStrings
Behavour is correct for
vcat
ingVector{String}
toVector{ShortSting3}
though. That does promote toString
This requires #18 to be efficient
The text was updated successfully, but these errors were encountered: