<p dir="auto">...in the case that a file is included twice. In that case, it shows up as</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="WARNING: Method definition (::Type{PseudoArcLengthContinuation.DefaultLS})() in module PseudoArcLengthContinuation at /Users/rveltz/work/prog_gd/julia/dev/dev1/PseudoArcLengthContinuation.jl/src/LinearSolver.jl:62 overwritten at /Users/rveltz/work/prog_gd/julia/dev/dev1/PseudoArcLengthContinuation.jl/src/LinearSolver.jl:62.
  ** incremental compilation may be fatally broken for this module **"><pre class="notranslate">WARNING<span class="pl-k">:</span> Method definition (<span class="pl-k">::</span><span class="pl-c1">Type{PseudoArcLengthContinuation.DefaultLS}</span>)() <span class="pl-k">in</span> <span class="pl-k">module</span> PseudoArcLengthContinuation at <span class="pl-k">/</span>Users<span class="pl-k">/</span>rveltz<span class="pl-k">/</span>work<span class="pl-k">/</span>prog_gd<span class="pl-k">/</span>julia<span class="pl-k">/</span>dev<span class="pl-k">/</span>dev1<span class="pl-k">/</span>PseudoArcLengthContinuation<span class="pl-k">.</span>jl<span class="pl-k">/</span>src<span class="pl-k">/</span>LinearSolver<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">62</span> overwritten at <span class="pl-k">/</span>Users<span class="pl-k">/</span>rveltz<span class="pl-k">/</span>work<span class="pl-k">/</span>prog_gd<span class="pl-k">/</span>julia<span class="pl-k">/</span>dev<span class="pl-k">/</span>dev1<span class="pl-k">/</span>PseudoArcLengthContinuation<span class="pl-k">.</span>jl<span class="pl-k">/</span>src<span class="pl-k">/</span>LinearSolver<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">62.</span>
  <span class="pl-k">**</span> incremental compilation may be fatally broken <span class="pl-k">for</span> this <span class="pl-k">module</span> <span class="pl-k">**</span></pre></div>
<p dir="auto">(example from Slack). This is actually really helpful if you know the only way a method at <code class="notranslate">LinearSolver.jl:62</code> can overwrite a method at <code class="notranslate">LinearSolver.jl:62</code> is if the code is being evaluated twice, i.e., a duplicated <code class="notranslate">include</code> statement, but is pretty confusing if you don't realize that is possiblity. I propose adding a check to see if the file path and line number is the same for the two methods, and in that case changing the warning to something like</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="WARNING: Method definition (::Type{PseudoArcLengthContinuation.DefaultLS})() in module PseudoArcLengthContinuation at /Users/rveltz/work/prog_gd/julia/dev/dev1/PseudoArcLengthContinuation.jl/src/LinearSolver.jl:62 evaluated twice. Check for duplicate `include` statements.
  ** incremental compilation may be fatally broken for this module **"><pre class="notranslate">WARNING<span class="pl-k">:</span> Method definition (<span class="pl-k">::</span><span class="pl-c1">Type{PseudoArcLengthContinuation.DefaultLS}</span>)() <span class="pl-k">in</span> <span class="pl-k">module</span> PseudoArcLengthContinuation at <span class="pl-k">/</span>Users<span class="pl-k">/</span>rveltz<span class="pl-k">/</span>work<span class="pl-k">/</span>prog_gd<span class="pl-k">/</span>julia<span class="pl-k">/</span>dev<span class="pl-k">/</span>dev1<span class="pl-k">/</span>PseudoArcLengthContinuation<span class="pl-k">.</span>jl<span class="pl-k">/</span>src<span class="pl-k">/</span>LinearSolver<span class="pl-k">.</span>jl<span class="pl-k">:</span><span class="pl-c1">62</span> evaluated twice. Check <span class="pl-k">for</span> duplicate <span class="pl-s"><span class="pl-pds">`</span>include<span class="pl-pds">`</span></span> statements.
  <span class="pl-k">**</span> incremental compilation may be fatally broken <span class="pl-k">for</span> this <span class="pl-k">module</span> <span class="pl-k">**</span></pre></div>
<p dir="auto">The warning is generated here </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/3b53f54a5e612cfc402f561d71cdbfb40da3529e/src/gf.c#L1372-L1387">julia/src/gf.c</a>
    </p>
    <p class="mb-0 color-fg-muted">
        Lines 1372 to 1387
      in
      <a data-pjax="true" class="commit-tease-sha" href="/JuliaLang/julia/commit/3b53f54a5e612cfc402f561d71cdbfb40da3529e">3b53f54</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="L1372" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1372"></td>
          <td id="LC1372" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> (<span class="pl-s1">jl_options</span>.<span class="pl-c1">warn_overwrite</span> <span class="pl-c1">==</span> <span class="pl-c1">JL_OPTIONS_WARN_OVERWRITE_ON</span>) { </td>
        </tr>

        <tr class="border-0">
          <td id="L1373" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1373"></td>
          <td id="LC1373" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-smi">jl_method_t</span> <span class="pl-c1">*</span><span class="pl-s1">method</span> <span class="pl-c1">=</span> (<span class="pl-smi">jl_method_t</span><span class="pl-c1">*</span>)<span class="pl-s1">newentry</span><span class="pl-c1">-&gt;</span><span class="pl-c1">func</span>.<span class="pl-c1">method</span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L1374" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1374"></td>
          <td id="LC1374" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-smi">jl_module_t</span> <span class="pl-c1">*</span><span class="pl-s1">newmod</span> <span class="pl-c1">=</span> <span class="pl-s1">method</span><span class="pl-c1">-&gt;</span><span class="pl-c1">module</span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L1375" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1375"></td>
          <td id="LC1375" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-smi">jl_module_t</span> <span class="pl-c1">*</span><span class="pl-s1">oldmod</span> <span class="pl-c1">=</span> <span class="pl-s1">oldvalue</span><span class="pl-c1">-&gt;</span><span class="pl-c1">module</span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L1376" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1376"></td>
          <td id="LC1376" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-smi">JL_STREAM</span> <span class="pl-c1">*</span><span class="pl-s1">s</span> <span class="pl-c1">=</span> <span class="pl-c1">JL_STDERR</span>; </td>
        </tr>

        <tr class="border-0">
          <td id="L1377" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1377"></td>
          <td id="LC1377" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">jl_printf</span>(<span class="pl-s1">s</span>, <span class="pl-s">"WARNING: Method definition "</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1378" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1378"></td>
          <td id="LC1378" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">jl_static_show_func_sig</span>(<span class="pl-s1">s</span>, (<span class="pl-smi">jl_value_t</span><span class="pl-c1">*</span>)<span class="pl-s1">newentry</span><span class="pl-c1">-&gt;</span><span class="pl-c1">sig</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1379" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1379"></td>
          <td id="LC1379" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">jl_printf</span>(<span class="pl-s1">s</span>, <span class="pl-s">" in module %s"</span>, <span class="pl-en">jl_symbol_name</span>(<span class="pl-s1">oldmod</span><span class="pl-c1">-&gt;</span><span class="pl-c1">name</span>)); </td>
        </tr>

        <tr class="border-0">
          <td id="L1380" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1380"></td>
          <td id="LC1380" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">print_func_loc</span>(<span class="pl-s1">s</span>, <span class="pl-s1">oldvalue</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1381" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1381"></td>
          <td id="LC1381" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">jl_printf</span>(<span class="pl-s1">s</span>, <span class="pl-s">" overwritten"</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1382" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1382"></td>
          <td id="LC1382" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-k">if</span> (<span class="pl-s1">oldmod</span> <span class="pl-c1">!=</span> <span class="pl-s1">newmod</span>) </td>
        </tr>

        <tr class="border-0">
          <td id="L1383" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1383"></td>
          <td id="LC1383" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">         <span class="pl-en">jl_printf</span>(<span class="pl-s1">s</span>, <span class="pl-s">" in module %s"</span>, <span class="pl-en">jl_symbol_name</span>(<span class="pl-s1">newmod</span><span class="pl-c1">-&gt;</span><span class="pl-c1">name</span>)); </td>
        </tr>

        <tr class="border-0">
          <td id="L1384" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1384"></td>
          <td id="LC1384" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">print_func_loc</span>(<span class="pl-s1">s</span>, <span class="pl-s1">method</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1385" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1385"></td>
          <td id="LC1385" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">jl_printf</span>(<span class="pl-s1">s</span>, <span class="pl-s">".\n"</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1386" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1386"></td>
          <td id="LC1386" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line">     <span class="pl-en">jl_uv_flush</span>(<span class="pl-s1">s</span>); </td>
        </tr>

        <tr class="border-0">
          <td id="L1387" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="1387"></td>
          <td id="LC1387" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> } </td>
        </tr>
    </tbody></table>
  </div>
</div>
 but I don't really know C, so I filed this issue instead of making a PR.<p></p>
<p dir="auto">Version: 0.4.0-dev+6494 <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/JuliaLang/julia/commit/e66175b75865632afa7c0a373db4a3591305b451/hovercard" href="https://github.com/JuliaLang/julia/commit/e66175b75865632afa7c0a373db4a3591305b451"><tt>e66175b</tt></a></p>
<p dir="auto">Minimal example:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="@inline function f(A::AbstractArray, I1, I2, I3)
    (size(A,1) &gt;= I1 &amp;&amp; size(A,2) &gt;= I2) &amp;&amp; size(A,3) &gt;= I3
end
h(A) = f(A, 1, 2, 3)

code_typed(f, (Array{Int, 3}, Int, Int, Int)) # is ok
code_typed(h, (Array{Int, 3},)) # has an unreachable error(&quot;fatal error in type inference&quot;)
code_llvm(f, (Array{Int, 3}, Int, Int, Int)) # no gc frame
code_llvm(h, (Array{Int, 3},)) # gc frame (with nothing put into it, I think)"><pre class="notranslate"><span class="pl-c1">@inline</span> <span class="pl-k">function</span> <span class="pl-en">f</span>(A<span class="pl-k">::</span><span class="pl-c1">AbstractArray</span>, I1, I2, I3)
    (<span class="pl-c1">size</span>(A,<span class="pl-c1">1</span>) <span class="pl-k">&gt;=</span> I1 <span class="pl-k">&amp;&amp;</span> <span class="pl-c1">size</span>(A,<span class="pl-c1">2</span>) <span class="pl-k">&gt;=</span> I2) <span class="pl-k">&amp;&amp;</span> <span class="pl-c1">size</span>(A,<span class="pl-c1">3</span>) <span class="pl-k">&gt;=</span> I3
<span class="pl-k">end</span>
<span class="pl-en">h</span>(A) <span class="pl-k">=</span> <span class="pl-c1">f</span>(A, <span class="pl-c1">1</span>, <span class="pl-c1">2</span>, <span class="pl-c1">3</span>)

<span class="pl-c1">code_typed</span>(f, (Array{Int, <span class="pl-c1">3</span>}, Int, Int, Int)) <span class="pl-c"><span class="pl-c">#</span> is ok</span>
<span class="pl-c1">code_typed</span>(h, (Array{Int, <span class="pl-c1">3</span>},)) <span class="pl-c"><span class="pl-c">#</span> has an unreachable error("fatal error in type inference")</span>
<span class="pl-c1">code_llvm</span>(f, (Array{Int, <span class="pl-c1">3</span>}, Int, Int, Int)) <span class="pl-c"><span class="pl-c">#</span> no gc frame</span>
<span class="pl-c1">code_llvm</span>(h, (Array{Int, <span class="pl-c1">3</span>},)) <span class="pl-c"><span class="pl-c">#</span> gc frame (with nothing put into it, I think)</span></pre></div>
<p dir="auto">Full output: <a href="https://gist.github.com/mbauman/a4e9fb36f67e2287a8f6">https://gist.github.com/mbauman/a4e9fb36f67e2287a8f6</a></p>