<p dir="auto"><a href="https://discourse.julialang.org/t/suggestion-julia-version-header-in-jl-files/16316" rel="nofollow">https://discourse.julialang.org/t/suggestion-julia-version-header-in-jl-files/16316</a></p>
<p dir="auto">strongly suggest a header in .jl files that indicates the version under which the file is running.  issue a warning if this is not the first line in the .jl file.  I would suggest</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="#!julia 1.0.0 1.0.1"><pre class="notranslate"><code class="notranslate">#!julia 1.0.0 1.0.1
</code></pre></div>
<p dir="auto">where the first version on which this .jl was tested on is 1.0.0 and the last version is 1.0.1.</p>
<p dir="auto">In the distant future, such a requirement will help you by making it easier for you to deprecate and break features without incurring the wrath of every user who has ever written a julia program.  I understand that packages have some REQUIRE aspects already, but this is different.  the shebang line should be in every .jl file, user or packaged.</p>
<p dir="auto">a secondary minor advantage is easier recognition for unix <code class="notranslate">file</code>.</p>
<p dir="auto">regards,</p>
<p dir="auto">/iaw</p>
<p dir="auto">There's a test in DataFrames that's intermittently failing due to something that looks like an inference bug. When I run <code class="notranslate">finfer(getindex, (BitArray{2}, Int64, Range1{Int64}))</code> immediately after starting Julia, I sometimes get:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="finfer(getindex, (BitArray{2}, Int64, Range1{Int64}))
:($(Expr(:lambda, {:B, :(I::top(apply_type)(Vararg,Union(Real,AbstractVector)))}, {{:X, :Xc}, {{:B, BitArray{2}, 0}, {:I, Any, 2}, {:X, BitArray{2}, 2}, {:Xc, Array{Uint64,1}, 2}}, {{:getindex_cache, Any, 7}}}, quote  # bitarray.jl, line 471:
        I = top(tuple)(indices(tupleref(I::(Int64,Range1{Int64}),1)::Union(Range1{Int64},Int64)),indices(tupleref(I::(Int64,Range1{Int64}),2)::Union(Range1{Int64},Int64)))::(Any,Any) # line 472:
        X = BitArray(index_shape(top(tupleref)(I::(Any,Any),1),top(tupleref)(I::(Any,Any),2))::Union((),(Any,),(Any,Any)))::BitArray{2} # line 473:
        Xc = top(getfield)(X::BitArray{2},:chunks)::Array{Uint64,1} # line 475:
        unless is(getindex_cache,nothing)::Bool goto 0 # line 476:
        getindex_cache = $(Dict{Any,Any})()::Dict{Any,Any}
        0:  # line 478:
        gen_cartesian_map(getindex_cache,$(AST(:($(Expr(:lambda, {:(ivars::Any)}, {{:#s143, :#s137}, {{:ivars, Any, 0}, {:#s143, Array{Any,1}, 2}, {:#s137, Array{Any,1}, 2}}, {}}, quote  # bitarray.jl, line 478:
        #s143 = top(ccall)(:jl_alloc_array_1d,$(Array{Any,1}),top(tuple)(Any,Int)::(Type{Any},Type{Int64}),$(Array{Any,1}),0,1,0)::Array{Any,1}
        top(arrayset)(#s143::Array{Any,1},:B,1)::Array{Any,1}
        #s137 = #s143::Array{Any,1}
        return top(Expr)(:block,top(Expr)(:line,480,:bitarray.jl)::Expr,top(Expr)(:call,:setindex_unchecked,:Xc,top(splicedexpr)(:ref,top(append_any)(#s137::Array{Any,1},ivars)::Array{Any,1})::Expr,:ind)::Expr,top(Expr)(:line,481)::Expr,top(Expr)(:+=,:ind,1)::Expr)::Expr
    end))))),I::(Any,Any),top(tuple)(:B,:Xc,:ind)::(Symbol,Symbol,Symbol),B::BitArray{2},Xc::Array{Uint64,1},1) # line 483:
        return X::BitArray{2}
    end)))"><pre class="notranslate"><span class="pl-c1">finfer</span>(getindex, (BitArray{<span class="pl-c1">2</span>}, Int64, Range1{Int64}))
:(<span class="pl-k">$</span>(<span class="pl-c1">Expr</span>(<span class="pl-c1">:lambda</span>, {<span class="pl-c1">:B</span>, :(I<span class="pl-k">::</span><span class="pl-c1">top</span>(apply_type)(Vararg,<span class="pl-c1">Union</span>(Real,AbstractVector)))}, {{<span class="pl-c1">:X</span>, <span class="pl-c1">:Xc</span>}, {{<span class="pl-c1">:B</span>, BitArray{<span class="pl-c1">2</span>}, <span class="pl-c1">0</span>}, {<span class="pl-c1">:I</span>, Any, <span class="pl-c1">2</span>}, {<span class="pl-c1">:X</span>, BitArray{<span class="pl-c1">2</span>}, <span class="pl-c1">2</span>}, {<span class="pl-c1">:Xc</span>, Array{Uint64,<span class="pl-c1">1</span>}, <span class="pl-c1">2</span>}}, {{<span class="pl-c1">:getindex_cache</span>, Any, <span class="pl-c1">7</span>}}}, <span class="pl-k">quote</span>  <span class="pl-c"><span class="pl-c">#</span> bitarray.jl, line 471:</span>
        I <span class="pl-k">=</span> <span class="pl-c1">top</span>(tuple)(<span class="pl-c1">indices</span>(<span class="pl-c1">tupleref</span>(I<span class="pl-k">::</span><span class="pl-c1">(Int64,Range1{Int64})</span>,<span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Union(Range1{Int64},Int64)</span>),<span class="pl-c1">indices</span>(<span class="pl-c1">tupleref</span>(I<span class="pl-k">::</span><span class="pl-c1">(Int64,Range1{Int64})</span>,<span class="pl-c1">2</span>)<span class="pl-k">::</span><span class="pl-c1">Union(Range1{Int64},Int64)</span>))<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span> <span class="pl-c"><span class="pl-c">#</span> line 472:</span>
        X <span class="pl-k">=</span> <span class="pl-c1">BitArray</span>(<span class="pl-c1">index_shape</span>(<span class="pl-c1">top</span>(tupleref)(I<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span>,<span class="pl-c1">1</span>),<span class="pl-c1">top</span>(tupleref)(I<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span>,<span class="pl-c1">2</span>))<span class="pl-k">::</span><span class="pl-c1">Union(()</span>,(Any,),(Any,Any)))<span class="pl-k">::</span><span class="pl-c1">BitArray{2}</span> <span class="pl-c"><span class="pl-c">#</span> line 473:</span>
        Xc <span class="pl-k">=</span> <span class="pl-c1">top</span>(getfield)(X<span class="pl-k">::</span><span class="pl-c1">BitArray{2}</span>,<span class="pl-c1">:chunks</span>)<span class="pl-k">::</span><span class="pl-c1">Array{Uint64,1}</span> <span class="pl-c"><span class="pl-c">#</span> line 475:</span>
        unless <span class="pl-c1">is</span>(getindex_cache,<span class="pl-c1">nothing</span>)<span class="pl-k">::</span><span class="pl-c1">Bool</span> goto <span class="pl-c1">0</span> <span class="pl-c"><span class="pl-c">#</span> line 476:</span>
        getindex_cache <span class="pl-k">=</span> <span class="pl-k">$</span>(Dict{Any,Any})()<span class="pl-k">::</span><span class="pl-c1">Dict{Any,Any}</span>
        <span class="pl-c1">0</span><span class="pl-k">:</span>  <span class="pl-c"><span class="pl-c">#</span> line 478:</span>
        <span class="pl-c1">gen_cartesian_map</span>(getindex_cache,<span class="pl-k">$</span>(<span class="pl-c1">AST</span>(:(<span class="pl-k">$</span>(<span class="pl-c1">Expr</span>(<span class="pl-c1">:lambda</span>, {:(ivars<span class="pl-k">::</span><span class="pl-c1">Any</span>)}, {{:<span class="pl-c"><span class="pl-c">#</span>s143, :#s137}, {{:ivars, Any, 0}, {:#s143, Array{Any,1}, 2}, {:#s137, Array{Any,1}, 2}}, {}}, quote  # bitarray.jl, line 478:</span>
        <span class="pl-c"><span class="pl-c">#</span>s143 = top(ccall)(:jl_alloc_array_1d,$(Array{Any,1}),top(tuple)(Any,Int)::(Type{Any},Type{Int64}),$(Array{Any,1}),0,1,0)::Array{Any,1}</span>
        <span class="pl-c1">top</span>(arrayset)(<span class="pl-c"><span class="pl-c">#</span>s143::Array{Any,1},:B,1)::Array{Any,1}</span>
        <span class="pl-c"><span class="pl-c">#</span>s137 = #s143::Array{Any,1}</span>
        <span class="pl-k">return</span> <span class="pl-en">top</span>(Expr)(<span class="pl-c1">:block</span>,<span class="pl-en">top</span>(Expr)(<span class="pl-c1">:line</span>,<span class="pl-c1">480</span>,<span class="pl-c1">:bitarray</span><span class="pl-k">.</span>jl)<span class="pl-k">::</span><span class="pl-c1">Expr</span>,<span class="pl-c1">top</span>(Expr)(<span class="pl-c1">:call</span>,<span class="pl-c1">:setindex_unchecked</span>,<span class="pl-c1">:Xc</span>,<span class="pl-c1">top</span>(splicedexpr)(<span class="pl-c1">:ref</span>,<span class="pl-c1">top</span>(append_any)(<span class="pl-c"><span class="pl-c">#</span>s137::Array{Any,1},ivars)::Array{Any,1})::Expr,:ind)::Expr,top(Expr)(:line,481)::Expr,top(Expr)(:+=,:ind,1)::Expr)::Expr</span>
    <span class="pl-k">end</span>))))),I<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span>,<span class="pl-c1">top</span>(tuple)(<span class="pl-c1">:B</span>,<span class="pl-c1">:Xc</span>,<span class="pl-c1">:ind</span>)<span class="pl-k">::</span><span class="pl-c1">(Symbol,Symbol,Symbol)</span>,B<span class="pl-k">::</span><span class="pl-c1">BitArray{2}</span>,Xc<span class="pl-k">::</span><span class="pl-c1">Array{Uint64,1}</span>,<span class="pl-c1">1</span>) <span class="pl-c"><span class="pl-c">#</span> line 483:</span>
        <span class="pl-k">return</span> X<span class="pl-k">::</span><span class="pl-c1">BitArray{2}</span>
    <span class="pl-k">end</span>)))</pre></div>
<p dir="auto">which looks okay. Other times I get:</p>
<div class="highlight highlight-source-julia notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="finfer(getindex, (BitArray{2}, Int64, Range1{Int64}))
:($(Expr(:lambda, {:B, :(I::top(apply_type)(Vararg,Union(Real,AbstractVector)))}, {{:X, :Xc}, {{:B, BitArray{2}, 0}, {:I, Any, 2}, {:X, BitArray{1}, 2}, {:Xc, Array{Uint64,1}, 2}}, {{:getindex_cache, Any, 7}}}, quote  # bitarray.jl, line 471:
        I = top(tuple)(indices(tupleref(I::(Int64,Range1{Int64}),1)::Union(Int64,Range1{Int64})),indices(tupleref(I::(Int64,Range1{Int64}),2)::Union(Int64,Range1{Int64})))::(Any,Any) # line 472:
        X = BitArray(index_shape(top(tupleref)(I::(Any,Any),1),top(tupleref)(I::(Any,Any),2))::Union((),(Any,Any),(Any,)))::BitArray{1} # line 473:
        Xc = top(getfield)(X::BitArray{1},:chunks)::Array{Uint64,1} # line 475:
        unless is(getindex_cache,nothing)::Bool goto 0 # line 476:
        getindex_cache = $(Dict{Any,Any})()::Dict{Any,Any}
        0:  # line 478:
        gen_cartesian_map(getindex_cache,$(AST(:($(Expr(:lambda, {:(ivars::Any)}, {{:#s143, :#s137}, {{:ivars, Any, 0}, {:#s143, Array{Any,1}, 2}, {:#s137, Array{Any,1}, 2}}, {}}, quote  # bitarray.jl, line 478:
        #s143 = top(ccall)(:jl_alloc_array_1d,$(Array{Any,1}),top(tuple)(Any,Int)::(Type{Any},Type{Int64}),$(Array{Any,1}),0,1,0)::Array{Any,1}
        top(arrayset)(#s143::Array{Any,1},:B,1)::Array{Any,1}
        #s137 = #s143::Array{Any,1}
        return top(Expr)(:block,top(Expr)(:line,480,:bitarray.jl)::Expr,top(Expr)(:call,:setindex_unchecked,:Xc,top(splicedexpr)(:ref,top(append_any)(#s137::Array{Any,1},ivars)::Array{Any,1})::Expr,:ind)::Expr,top(Expr)(:line,481)::Expr,top(Expr)(:+=,:ind,1)::Expr)::Expr
    end))))),I::(Any,Any),top(tuple)(:B,:Xc,:ind)::(Symbol,Symbol,Symbol),B::BitArray{2},Xc::Array{Uint64,1},1) # line 483:
        return X::BitArray{1}
    end)))"><pre class="notranslate"><span class="pl-c1">finfer</span>(getindex, (BitArray{<span class="pl-c1">2</span>}, Int64, Range1{Int64}))
:(<span class="pl-k">$</span>(<span class="pl-c1">Expr</span>(<span class="pl-c1">:lambda</span>, {<span class="pl-c1">:B</span>, :(I<span class="pl-k">::</span><span class="pl-c1">top</span>(apply_type)(Vararg,<span class="pl-c1">Union</span>(Real,AbstractVector)))}, {{<span class="pl-c1">:X</span>, <span class="pl-c1">:Xc</span>}, {{<span class="pl-c1">:B</span>, BitArray{<span class="pl-c1">2</span>}, <span class="pl-c1">0</span>}, {<span class="pl-c1">:I</span>, Any, <span class="pl-c1">2</span>}, {<span class="pl-c1">:X</span>, BitArray{<span class="pl-c1">1</span>}, <span class="pl-c1">2</span>}, {<span class="pl-c1">:Xc</span>, Array{Uint64,<span class="pl-c1">1</span>}, <span class="pl-c1">2</span>}}, {{<span class="pl-c1">:getindex_cache</span>, Any, <span class="pl-c1">7</span>}}}, <span class="pl-k">quote</span>  <span class="pl-c"><span class="pl-c">#</span> bitarray.jl, line 471:</span>
        I <span class="pl-k">=</span> <span class="pl-c1">top</span>(tuple)(<span class="pl-c1">indices</span>(<span class="pl-c1">tupleref</span>(I<span class="pl-k">::</span><span class="pl-c1">(Int64,Range1{Int64})</span>,<span class="pl-c1">1</span>)<span class="pl-k">::</span><span class="pl-c1">Union(Int64,Range1{Int64})</span>),<span class="pl-c1">indices</span>(<span class="pl-c1">tupleref</span>(I<span class="pl-k">::</span><span class="pl-c1">(Int64,Range1{Int64})</span>,<span class="pl-c1">2</span>)<span class="pl-k">::</span><span class="pl-c1">Union(Int64,Range1{Int64})</span>))<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span> <span class="pl-c"><span class="pl-c">#</span> line 472:</span>
        X <span class="pl-k">=</span> <span class="pl-c1">BitArray</span>(<span class="pl-c1">index_shape</span>(<span class="pl-c1">top</span>(tupleref)(I<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span>,<span class="pl-c1">1</span>),<span class="pl-c1">top</span>(tupleref)(I<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span>,<span class="pl-c1">2</span>))<span class="pl-k">::</span><span class="pl-c1">Union(()</span>,(Any,Any),(Any,)))<span class="pl-k">::</span><span class="pl-c1">BitArray{1}</span> <span class="pl-c"><span class="pl-c">#</span> line 473:</span>
        Xc <span class="pl-k">=</span> <span class="pl-c1">top</span>(getfield)(X<span class="pl-k">::</span><span class="pl-c1">BitArray{1}</span>,<span class="pl-c1">:chunks</span>)<span class="pl-k">::</span><span class="pl-c1">Array{Uint64,1}</span> <span class="pl-c"><span class="pl-c">#</span> line 475:</span>
        unless <span class="pl-c1">is</span>(getindex_cache,<span class="pl-c1">nothing</span>)<span class="pl-k">::</span><span class="pl-c1">Bool</span> goto <span class="pl-c1">0</span> <span class="pl-c"><span class="pl-c">#</span> line 476:</span>
        getindex_cache <span class="pl-k">=</span> <span class="pl-k">$</span>(Dict{Any,Any})()<span class="pl-k">::</span><span class="pl-c1">Dict{Any,Any}</span>
        <span class="pl-c1">0</span><span class="pl-k">:</span>  <span class="pl-c"><span class="pl-c">#</span> line 478:</span>
        <span class="pl-c1">gen_cartesian_map</span>(getindex_cache,<span class="pl-k">$</span>(<span class="pl-c1">AST</span>(:(<span class="pl-k">$</span>(<span class="pl-c1">Expr</span>(<span class="pl-c1">:lambda</span>, {:(ivars<span class="pl-k">::</span><span class="pl-c1">Any</span>)}, {{:<span class="pl-c"><span class="pl-c">#</span>s143, :#s137}, {{:ivars, Any, 0}, {:#s143, Array{Any,1}, 2}, {:#s137, Array{Any,1}, 2}}, {}}, quote  # bitarray.jl, line 478:</span>
        <span class="pl-c"><span class="pl-c">#</span>s143 = top(ccall)(:jl_alloc_array_1d,$(Array{Any,1}),top(tuple)(Any,Int)::(Type{Any},Type{Int64}),$(Array{Any,1}),0,1,0)::Array{Any,1}</span>
        <span class="pl-c1">top</span>(arrayset)(<span class="pl-c"><span class="pl-c">#</span>s143::Array{Any,1},:B,1)::Array{Any,1}</span>
        <span class="pl-c"><span class="pl-c">#</span>s137 = #s143::Array{Any,1}</span>
        <span class="pl-k">return</span> <span class="pl-en">top</span>(Expr)(<span class="pl-c1">:block</span>,<span class="pl-en">top</span>(Expr)(<span class="pl-c1">:line</span>,<span class="pl-c1">480</span>,<span class="pl-c1">:bitarray</span><span class="pl-k">.</span>jl)<span class="pl-k">::</span><span class="pl-c1">Expr</span>,<span class="pl-c1">top</span>(Expr)(<span class="pl-c1">:call</span>,<span class="pl-c1">:setindex_unchecked</span>,<span class="pl-c1">:Xc</span>,<span class="pl-c1">top</span>(splicedexpr)(<span class="pl-c1">:ref</span>,<span class="pl-c1">top</span>(append_any)(<span class="pl-c"><span class="pl-c">#</span>s137::Array{Any,1},ivars)::Array{Any,1})::Expr,:ind)::Expr,top(Expr)(:line,481)::Expr,top(Expr)(:+=,:ind,1)::Expr)::Expr</span>
    <span class="pl-k">end</span>))))),I<span class="pl-k">::</span><span class="pl-c1">(Any,Any)</span>,<span class="pl-c1">top</span>(tuple)(<span class="pl-c1">:B</span>,<span class="pl-c1">:Xc</span>,<span class="pl-c1">:ind</span>)<span class="pl-k">::</span><span class="pl-c1">(Symbol,Symbol,Symbol)</span>,B<span class="pl-k">::</span><span class="pl-c1">BitArray{2}</span>,Xc<span class="pl-k">::</span><span class="pl-c1">Array{Uint64,1}</span>,<span class="pl-c1">1</span>) <span class="pl-c"><span class="pl-c">#</span> line 483:</span>
        <span class="pl-k">return</span> X<span class="pl-k">::</span><span class="pl-c1">BitArray{1}</span>
    <span class="pl-k">end</span>)))</pre></div>
<p dir="auto">which gives the wrong return type.</p>