<p dir="auto">Methods in Dates have a habit of causing ambiguities for packages that define new AbstractArray types, e.g., <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="171066945" data-permission-text="Title is private" data-url="https://github.com/JuliaArrays/StaticArrays.jl/issues/18" data-hovercard-type="issue" data-hovercard-url="/JuliaArrays/StaticArrays.jl/issues/18/hovercard" href="https://github.com/JuliaArrays/StaticArrays.jl/issues/18">JuliaArrays/StaticArrays.jl#18</a> where nearly half of the ambiguities are due to Dates-related methods. The problem, in a nutshell, is that Dates specializes several AbstractArray methods on the element type whereas packages tend to specialize on the container type.</p>
<p dir="auto">Getting rid of such ambiguity warnings, back in the days of 0.4-dev, was the final trigger for introducing <code class="notranslate">promote_op</code> (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="96957776" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/12292" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/12292/hovercard" href="https://github.com/JuliaLang/julia/pull/12292">#12292</a> and <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="97953320" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/12370" data-hovercard-type="pull_request" data-hovercard-url="/JuliaLang/julia/pull/12370/hovercard" href="https://github.com/JuliaLang/julia/pull/12370">#12370</a>); now that we've gotten rid of it, it would be lovely to see whether we can reduce the ambiguity-causing footprint of Dates even further.</p>
<p dir="auto">Now that ambiguities are silent until called this is not as crucial as it once was, but ideally we'd like to move to a world where packages can include <code class="notranslate">detect_ambiguities</code> as part of their tests.</p>
<p dir="auto">Dates redefines <code class="notranslate">+(::Array{Date}, Date...) = .+</code>, meaning that array + scalar doesn't throw an error.</p>
<p dir="auto"></p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/JuliaLang/julia/blob/f8d82ccba81223c9d0d43e4077acb2a208bedc7a/stdlib/Dates/src/arithmetic.jl#L94">julia/stdlib/Dates/src/arithmetic.jl</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 94
      in
      <a data-pjax="true" class="commit-tease-sha" href="/JuliaLang/julia/commit/f8d82ccba81223c9d0d43e4077acb2a208bedc7a">f8d82cc</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L94" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="94"></td>
          <td id="LC94" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> (<span class="pl-k">-</span>)(x<span class="pl-k">::</span><span class="pl-c1">AbstractArray{T}</span>, y<span class="pl-k">::</span><span class="pl-c1">T</span>) <span class="pl-k">where</span> {T<span class="pl-k">&lt;:</span><span class="pl-c1">TimeType</span>} <span class="pl-k">=</span> x <span class="pl-k">.-</span> y </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">This should probably be deprecated for consistency.</p>