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 50
Base.Dates ambiguity errors for array addition/subtraction #158
Comments
If you're working off of a recent unstable master of Base (and don't actually need support for adding/subtracting dats = (:DataArray, :AbstractDataArray)
for op in (:+, :-)
for dat1 in dats
for dat2 in dats
@eval begin
($op){P<:Base.Dates.GeneralPeriod, Q<:Base.Dates.GeneralPeriod}(x::$dat1{P}, y::$dat2{Q}) = throw(MethodError)
($op){P<:Base.Dates.GeneralPeriod, T<:Base.Dates.TimeType}(x::$dat1{P}, y::$dat2{T}) = throw(MethodError)
($op){T<:Base.Dates.TimeType, P<:Base.Dates.GeneralPeriod}(x::$dat1{T}, y::$dat2{P}) = throw(MethodError)
($op){T<:Base.Dates.TimeType}(x::$dat1{T}, y::$dat2{T}) = throw(MethodError)
end #eval
end #for
@eval begin
($op){P<:Base.Dates.GeneralPeriod, Q<:Base.Dates.GeneralPeriod}(x::StridedArray{P}, y::$dat1{Q}) = throw(MethodError)
($op){P<:Base.Dates.GeneralPeriod, Q<:Base.Dates.GeneralPeriod}(x::$dat1{Q}, y::StridedArray{P}) = throw(MethodError)
($op){P<:Base.Dates.GeneralPeriod, T<:Base.Dates.TimeType}(x::StridedArray{P}, y::$dat1{T}) = throw(MethodError)
($op){T<:Base.Dates.TimeType, P<:Base.Dates.GeneralPeriod}(x::$dat1{T}, y::StridedArray{P}) = throw(MethodError)
($op){T<:Base.Dates.TimeType, P<:Base.Dates.GeneralPeriod}(x::Range{T}, y::$dat1{P}) = throw(MethodError)
($op){P<:Base.Dates.GeneralPeriod, T<:Base.Dates.TimeType}(x::$dat1{P}, y::Range{T}) = throw(MethodError)
($op){T<:Base.Dates.TimeType, P<:Base.Dates.GeneralPeriod}(x::AbstractArray{T}, y::$dat1{P}) = throw(MethodError)
($op){P<:Base.Dates.GeneralPeriod, T<:Base.Dates.TimeType}(x::$dat1{P}, y::AbstractArray{T}) = throw(MethodError)
($op){T<:Base.Dates.TimeType, U<:Base.Dates.TimeType}(x::Range{T}, y::$dat1{U}) = throw(MethodError)
($op){T<:Base.Dates.TimeType, U<:Base.Dates.TimeType}(x::$dat1{T}, y::Range{U}) = throw(MethodError)
($op){T<:Base.Dates.TimeType}(x::Range{T}, y::$dat1{T}) = throw(MethodError)
($op){T<:Base.Dates.TimeType}(x::$dat1{T}, y::Range{T}) = throw(MethodError)
($op){T<:Base.Dates.TimeType}(x::AbstractArray{T}, y::$dat1{T}) = throw(MethodError)
($op){T<:Base.Dates.TimeType}(x::$dat1{T}, y::AbstractArray{T}) = throw(MethodError)
end #eval
end #for
end #for |
JuliaLang/julia#12370 fixed this upstream. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
As noted by @jiahao in JuliaLang/julia#12115 (comment), JuliaLang/julia@79a2add extends
Base.Dates.TimeType
andBase.Dates.Period
/Base.Dates.CompoundPeriod
array operations, which results in new ambiguity errors for DataArray+
and-
methods:The text was updated successfully, but these errors were encountered: