<p dir="auto">This is a duplicate of <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="16682354" data-permission-text="Title is private" data-url="https://github.com/JuliaLang/julia/issues/3695" data-hovercard-type="issue" data-hovercard-url="/JuliaLang/julia/issues/3695/hovercard" href="https://github.com/JuliaLang/julia/issues/3695">#3695</a>, followed by more bad behavior. This is a relatively recent <code class="notranslate">.julia</code> directory that has only been used with Pkg2 (AFAIK) and only has one package installed (Options).</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="julia&gt; Pkg2.add(&quot;Winston&quot;)
MESSAGE: Cloning BinDeps from git://github.com/loladiro/BinDeps.jl.git
MESSAGE: Cloning Winston from git://github.com/nolta/Winston.jl.git
MESSAGE: Cloning Cairo from git://github.com/JuliaLang/Cairo.jl.git
MESSAGE: Cloning Color from git://github.com/JuliaLang/Color.jl.git
MESSAGE: Cloning IniFile from git://github.com/JuliaLang/IniFile.jl.git
MESSAGE: Cloning Tk from git://github.com/JuliaLang/Tk.jl.git
MESSAGE: Installing BinDeps v0.2.0
MESSAGE: Upgrading Options: v0.2.1- =&gt; v0.2.1
fatal: reference is not a tree: f1417b80ec7f3338275b2b692f7dc33289e50935
MESSAGE: Rolling back install of BinDeps
MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException(&quot;failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]&quot;)MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
..."><pre class="notranslate"><code class="notranslate">julia&gt; Pkg2.add("Winston")
MESSAGE: Cloning BinDeps from git://github.com/loladiro/BinDeps.jl.git
MESSAGE: Cloning Winston from git://github.com/nolta/Winston.jl.git
MESSAGE: Cloning Cairo from git://github.com/JuliaLang/Cairo.jl.git
MESSAGE: Cloning Color from git://github.com/JuliaLang/Color.jl.git
MESSAGE: Cloning IniFile from git://github.com/JuliaLang/IniFile.jl.git
MESSAGE: Cloning Tk from git://github.com/JuliaLang/Tk.jl.git
MESSAGE: Installing BinDeps v0.2.0
MESSAGE: Upgrading Options: v0.2.1- =&gt; v0.2.1
fatal: reference is not a tree: f1417b80ec7f3338275b2b692f7dc33289e50935
MESSAGE: Rolling back install of BinDeps
MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
ErrorException("failed process: Process(`mv BinDeps .trash/`, ProcessExited(1)) [1]")MESSAGE: Rolling back install of BinDeps
mv: cannot stat `BinDeps': No such file or directory
...
</code></pre></div>
<p dir="auto">I am running 1.63 on intel mac and 1.7 beta on M1 mac. both have this.  Julia is inconsistent in how it creates anonymous functions with an if statement. If I create one outside of a function it respects the if, but not inside.</p>
<p dir="auto">here is output that should be the same<br>
julia&gt; f3()<br>
f2<br>
julia&gt; fff()<br>
f1</p>
<p dir="auto">and the code</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="function f1()
    println(&quot;f1&quot;)
end
function f2()
    println(&quot;f2&quot;)
end
f3=function()
    if 1==1
        ff()=f1()
    end
    if 1==2
        ff()=f2()
    end
    ff()
end
if 1==1
    fff()=f1()
end
if 1==2
    fff()=f2()
end
fff()
f3()"><pre class="notranslate"><code class="notranslate">function f1()
    println("f1")
end
function f2()
    println("f2")
end
f3=function()
    if 1==1
        ff()=f1()
    end
    if 1==2
        ff()=f2()
    end
    ff()
end
if 1==1
    fff()=f1()
end
if 1==2
    fff()=f2()
end
fff()
f3()
</code></pre></div>