While using SQLite.jl, I’ve run into this error (but I don’t think it is really a SQLite question.)
MethodError: promote_type(::Type{Union{}}, ::Type{String}) is ambiguous. Candidates:
promote_type(::Type{Union{}}, ::Type{T}) where T in Base at promotion.jl:280
promote_type(::Type{T}, ::Type{String}) where T<:WeakRefStrings.InlineString in WeakRefStrings at C:\Users\nritchie\.julia\packages\WeakRefStrings\a3jYm\src\inlinestrings.jl:44
Possible fix, define
promote_type(::Type{Union{}}, ::Type{String})
If I understand correctly, Union{}
is an empty union of types.
So the first promote candidate promote_type(::Type{Union{}}, ::Type{T}) where T
is saying that when selecting between type no type or type T, always promote to type T.
The second candidate says when selecting between an InlineString and a String, promote to String.
Now, given this, I don’t understand why the second candidate is being proposed for promote_type(::Type{Union{}}, ::Type{String})
. As best I can tell, ::Type{Union{}}
does not match ::Type{<:InlineString}
.
What am I missing?